History

mov: set audio service type for AC-3 from bitstream mode in the 'dac3' atom.

Justin Ruggles committed 15 years ago

Commit eb81cf81 parent be187381 file · +5 −1Browse files

Unified · Split

libavformat/mov.c+5−1
@@ -492,16 +492,20 @@ static int mov_read_esds(MOVContext *c, AVIOContext *pb, MOVAtom atom) · 491 unmodified lines
492static int mov_read_dac3(MOVContext *c, AVIOContext *pb, MOVAtom atom)492static int mov_read_dac3(MOVContext *c, AVIOContext *pb, MOVAtom atom)
493{493{
494 AVStream *st;494 AVStream *st;
495 int ac3info, acmod, lfeon;495 int ac3info, acmod, lfeon, bsmod;
496 496
497 if (c->fc->nb_streams < 1)497 if (c->fc->nb_streams < 1)
498 return 0;498 return 0;
499 st = c->fc->streams[c->fc->nb_streams-1];499 st = c->fc->streams[c->fc->nb_streams-1];
500 500
501 ac3info = avio_rb24(pb);501 ac3info = avio_rb24(pb);
502 bsmod = (ac3info >> 14) & 0x7;
502 acmod = (ac3info >> 11) & 0x7;503 acmod = (ac3info >> 11) & 0x7;
503 lfeon = (ac3info >> 10) & 0x1;504 lfeon = (ac3info >> 10) & 0x1;
504 st->codec->channels = ((int[]){2,1,2,3,3,4,4,5})[acmod] + lfeon;505 st->codec->channels = ((int[]){2,1,2,3,3,4,4,5})[acmod] + lfeon;
506 st->codec->audio_service_type = bsmod;
507 if (st->codec->channels > 1 && bsmod == 0x7)
508 st->codec->audio_service_type = AV_AUDIO_SERVICE_TYPE_KARAOKE;
505 509
506 return 0;510 return 0;
507}511}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t