Revision e7452721

View differences:

libavformat/mov.c
1362 1362
    return 0;
1363 1363
}
1364 1364

  
1365
static int mov_read_cslg(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
1366
{
1367
    AVStream *st;
1368
    MOVStreamContext *sc;
1369

  
1370
    if (c->fc->nb_streams < 1)
1371
        return 0;
1372
    st = c->fc->streams[c->fc->nb_streams-1];
1373
    sc = st->priv_data;
1374

  
1375
    get_be32(pb); // version + flags
1376

  
1377
    sc->dts_shift = get_be32(pb);
1378
    dprintf(c->fc, "dts shift %d\n", sc->dts_shift);
1379

  
1380
    get_be32(pb); // least dts to pts delta
1381
    get_be32(pb); // greatest dts to pts delta
1382
    get_be32(pb); // pts start
1383
    get_be32(pb); // pts end
1384

  
1385
    return 0;
1386
}
1387

  
1388 1365
static int mov_read_ctts(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
1389 1366
{
1390 1367
    AVStream *st;
......
1415 1392

  
1416 1393
        sc->ctts_data[i].count   = count;
1417 1394
        sc->ctts_data[i].duration= duration;
1395
        if (duration < 0)
1396
            sc->dts_shift = FFMAX(sc->dts_shift, -duration);
1418 1397
    }
1398

  
1399
    dprintf(c->fc, "dts shift %d\n", sc->shift);
1400

  
1419 1401
    return 0;
1420 1402
}
1421 1403

  
......
1978 1960
static const MOVParseTableEntry mov_default_parse_table[] = {
1979 1961
{ MKTAG('a','v','s','s'), mov_read_extradata },
1980 1962
{ MKTAG('c','o','6','4'), mov_read_stco },
1981
{ MKTAG('c','s','l','g'), mov_read_cslg },
1982 1963
{ MKTAG('c','t','t','s'), mov_read_ctts }, /* composition time to sample */
1983 1964
{ MKTAG('d','i','n','f'), mov_read_default },
1984 1965
{ MKTAG('d','r','e','f'), mov_read_dref },

Also available in: Unified diff