diff options
author | Xinzheng Zhang <zhangxzheng@gmail.com> | 2016-09-14 16:13:45 +0800 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-09-18 00:18:11 +0200 |
commit | 0bdfdd6d2f57afef1ca1db1137c03809125a58b1 (patch) | |
tree | f85e4aa56c6d25de176e2ada64d4057298ede4ce | |
parent | f8dcc9e7189709c68829b0fa7a98941fdf916d68 (diff) | |
download | ffmpeg-0bdfdd6d2f57afef1ca1db1137c03809125a58b1.tar.gz |
avformat/utils: fix timebase error in avformat_seek_file()
When there is only one stream and stream_index has not specified,
The ts has been transferd by the timebase of stream0 without modifying the stream_index
In this condation it cause seek failure.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ecc04b4f2f29ac676e6c1d1ebf20ec45f5385f1e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/utils.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 930b235432..17c4ff0e90 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2245,6 +2245,7 @@ int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, max_ts = av_rescale_rnd(max_ts, time_base.den, time_base.num * (int64_t)AV_TIME_BASE, AV_ROUND_DOWN | AV_ROUND_PASS_MINMAX); + stream_index = 0; } ret = s->iformat->read_seek2(s, stream_index, min_ts, |