Revision eb81cf86

View differences:

libavformat/mov.c
492 492
static int mov_read_dac3(MOVContext *c, AVIOContext *pb, MOVAtom atom)
493 493
{
494 494
    AVStream *st;
495
    int ac3info, acmod, lfeon;
495
    int ac3info, acmod, lfeon, bsmod;
496 496

  
497 497
    if (c->fc->nb_streams < 1)
498 498
        return 0;
499 499
    st = c->fc->streams[c->fc->nb_streams-1];
500 500

  
501 501
    ac3info = avio_rb24(pb);
502
    bsmod = (ac3info >> 14) & 0x7;
502 503
    acmod = (ac3info >> 11) & 0x7;
503 504
    lfeon = (ac3info >> 10) & 0x1;
504 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 510
    return 0;
507 511
}

Also available in: Unified diff