aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-03-24 12:42:05 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2011-03-25 16:59:09 -0400
commiteb81cf860cbb23ece082e6a463a2c6ced8c55ead (patch)
tree3d5d767a355f75dbf3fd8555224322dfc1666f7d /libavformat
parentbe18738801b1723cc6aee126dfea466584012793 (diff)
downloadffmpeg-eb81cf860cbb23ece082e6a463a2c6ced8c55ead.tar.gz
mov: set audio service type for AC-3 from bitstream mode in the 'dac3' atom.
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mov.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 90de4f1d37..94f19a684a 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -492,16 +492,20 @@ static int mov_read_esds(MOVContext *c, AVIOContext *pb, MOVAtom atom)
static int mov_read_dac3(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
- int ac3info, acmod, lfeon;
+ int ac3info, acmod, lfeon, bsmod;
if (c->fc->nb_streams < 1)
return 0;
st = c->fc->streams[c->fc->nb_streams-1];
ac3info = avio_rb24(pb);
+ bsmod = (ac3info >> 14) & 0x7;
acmod = (ac3info >> 11) & 0x7;
lfeon = (ac3info >> 10) & 0x1;
st->codec->channels = ((int[]){2,1,2,3,3,4,4,5})[acmod] + lfeon;
+ st->codec->audio_service_type = bsmod;
+ if (st->codec->channels > 1 && bsmod == 0x7)
+ st->codec->audio_service_type = AV_AUDIO_SERVICE_TYPE_KARAOKE;
return 0;
}