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

set wrong_dts for iMovie created files which has huge ctts delay, fix ffmpeg_sample.m4v

Originally committed as revision 18181 to svn://svn.ffmpeg.org/ffmpeg/trunk
上级 1bbeb233
...@@ -1281,6 +1281,12 @@ static void mov_build_index(MOVContext *mov, AVStream *st) ...@@ -1281,6 +1281,12 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
int rescaled = sc->time_offset < 0 ? av_rescale(sc->time_offset, sc->time_scale, mov->time_scale) : sc->time_offset; int rescaled = sc->time_offset < 0 ? av_rescale(sc->time_offset, sc->time_scale, mov->time_scale) : sc->time_offset;
assert(sc->time_offset % sc->time_rate == 0); assert(sc->time_offset % sc->time_rate == 0);
current_dts = - (rescaled / sc->time_rate); current_dts = - (rescaled / sc->time_rate);
if (sc->ctts_data && sc->ctts_data[0].duration / sc->stts_data[0].duration > 16) {
/* more than 16 frames delay, dts are likely wrong
this happens with files created by iMovie */
sc->wrong_dts = 1;
st->codec->has_b_frames = 1;
}
} }
/* only use old uncompressed audio chunk demuxing when stts specifies it */ /* only use old uncompressed audio chunk demuxing when stts specifies it */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册