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
492492 static int mov_read_dac3(MOVContext *c, AVIOContext *pb, MOVAtom atom)
493493 {
494494 AVStream *st;
495− int ac3info, acmod, lfeon;
495+ int ac3info, acmod, lfeon, bsmod;
496496
497497 if (c->fc->nb_streams < 1)
498498 return 0;
499499 st = c->fc->streams[c->fc->nb_streams-1];
500500
501501 ac3info = avio_rb24(pb);
502+ bsmod = (ac3info >> 14) & 0x7;
502503 acmod = (ac3info >> 11) & 0x7;
503504 lfeon = (ac3info >> 10) & 0x1;
504505 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;
505509
506510 return 0;
507511 }

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