Unified · Split
| @@ -492,16 +492,20 @@ static int mov_read_esds(MOVContext *c, AVIOContext *pb, MOVAtom atom) · 491 unmodified lines | |||
| 492 | static int mov_read_dac3(MOVContext *c, AVIOContext *pb, MOVAtom atom) | 492 | static 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 | } |