提交 e7452721 编写于 作者: B Baptiste Coudurier

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
上级 fedb1eca
......@@ -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 },
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册