Revision bdecdd2b libavformat/mov.c

View differences:

libavformat/mov.c
559 559
    return ff_mov_read_esds(c->fc, pb, atom);
560 560
}
561 561

  
562
static int mov_read_dac3(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
563
{
564
    AVStream *st;
565
    int ac3info, acmod, lfeon;
566

  
567
    st = c->fc->streams[c->fc->nb_streams-1];
568

  
569
    ac3info = get_be24(pb);
570
    acmod = (ac3info >> 11) & 0x7;
571
    lfeon = (ac3info >> 10) & 0x1;
572
    st->codec->channels = ((int[]){2,1,2,3,3,4,4,5})[acmod] + lfeon;
573

  
574
    return 0;
575
}
576

  
562 577
static int mov_read_pasp(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
563 578
{
564 579
    const int num = get_be32(pb);
......
2245 2260
{ MKTAG('u','d','t','a'), mov_read_default },
2246 2261
{ MKTAG('w','a','v','e'), mov_read_wave },
2247 2262
{ MKTAG('e','s','d','s'), mov_read_esds },
2263
{ MKTAG('d','a','c','3'), mov_read_dac3 }, /* AC-3 info */
2248 2264
{ MKTAG('w','i','d','e'), mov_read_wide }, /* place holder */
2249 2265
{ MKTAG('c','m','o','v'), mov_read_cmov },
2250 2266
{ 0, NULL }

Also available in: Unified diff