diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2011-01-11 21:06:37 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2011-01-11 21:06:37 +0000 |
commit | c3024f9e7e4cc1a0dcedbdf96e08826d7a260cb8 (patch) | |
tree | dd5ad8aedb2ab7e078878e81237b11070cfb8a6b /libavformat/mov.c | |
parent | f6253caf8b4bcc36fbea8ccaf627edb4093a2c4b (diff) | |
download | ffmpeg-c3024f9e7e4cc1a0dcedbdf96e08826d7a260cb8.tar.gz |
In mov demuxer, handle better wrong time scale, fix issue #2528
Originally committed as revision 26311 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r-- | libavformat/mov.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 44e744312d..4370b48bc5 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1515,7 +1515,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st) uint64_t stream_size = 0; /* adjust first dts according to edit list */ - if (sc->time_offset) { + if (sc->time_offset && mov->time_scale > 0) { int rescaled = sc->time_offset < 0 ? av_rescale(sc->time_offset, sc->time_scale, mov->time_scale) : sc->time_offset; current_dts = -rescaled; if (sc->ctts_data && sc->stts_data && @@ -1750,10 +1750,10 @@ static int mov_read_trak(MOVContext *c, ByteIOContext *pb, MOVAtom atom) return 0; } - if (!sc->time_scale) { + if (sc->time_scale <= 0) { av_log(c->fc, AV_LOG_WARNING, "stream %d, timescale not set\n", st->index); sc->time_scale = c->time_scale; - if (!sc->time_scale) + if (sc->time_scale <= 0) sc->time_scale = 1; } |