summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-03-25 06:07:13 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-03-25 06:07:13 +0000
commitf03a081df09f9c4798a17d7e24446ed47924b11b (patch)
treedb62fc18e3442b96b6e03df0a199ca0015707079 /libavformat/mov.c
parent1bbeb2335615f5e9179947d64085bacaa812fe2f (diff)
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
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 0f17c6ecd5..5dd7928a60 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -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;
assert(sc->time_offset % sc->time_rate == 0);
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 */