mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-04 22:30:25 +00:00
compute dts shift with ctts value, cslg atom might be missing, fix #419
Originally committed as revision 20458 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
fedb1eca07
commit
e745272196
@ -1362,29 +1362,6 @@ static int mov_read_stts(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mov_read_cslg(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
|
||||
{
|
||||
AVStream *st;
|
||||
MOVStreamContext *sc;
|
||||
|
||||
if (c->fc->nb_streams < 1)
|
||||
return 0;
|
||||
st = c->fc->streams[c->fc->nb_streams-1];
|
||||
sc = st->priv_data;
|
||||
|
||||
get_be32(pb); // version + flags
|
||||
|
||||
sc->dts_shift = get_be32(pb);
|
||||
dprintf(c->fc, "dts shift %d\n", sc->dts_shift);
|
||||
|
||||
get_be32(pb); // least dts to pts delta
|
||||
get_be32(pb); // greatest dts to pts delta
|
||||
get_be32(pb); // pts start
|
||||
get_be32(pb); // pts end
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mov_read_ctts(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
|
||||
{
|
||||
AVStream *st;
|
||||
@ -1415,7 +1392,12 @@ static int mov_read_ctts(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
|
||||
|
||||
sc->ctts_data[i].count = count;
|
||||
sc->ctts_data[i].duration= duration;
|
||||
if (duration < 0)
|
||||
sc->dts_shift = FFMAX(sc->dts_shift, -duration);
|
||||
}
|
||||
|
||||
dprintf(c->fc, "dts shift %d\n", sc->shift);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1978,7 +1960,6 @@ static int mov_read_elst(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
|
||||
static const MOVParseTableEntry mov_default_parse_table[] = {
|
||||
{ MKTAG('a','v','s','s'), mov_read_extradata },
|
||||
{ MKTAG('c','o','6','4'), mov_read_stco },
|
||||
{ MKTAG('c','s','l','g'), mov_read_cslg },
|
||||
{ MKTAG('c','t','t','s'), mov_read_ctts }, /* composition time to sample */
|
||||
{ MKTAG('d','i','n','f'), mov_read_default },
|
||||
{ MKTAG('d','r','e','f'), mov_read_dref },
|
||||
|
Loading…
Reference in New Issue
Block a user