diff mbox

[FFmpeg-devel] avformat/utils: fix timebase error in avformat_seek_file()

Message ID 1473840825-61478-1-git-send-email-zhangxzheng@gmail.com
State Accepted
Commit ecc04b4f2f29ac676e6c1d1ebf20ec45f5385f1e
Headers show

Commit Message

Xinzheng Zhang Sept. 14, 2016, 8:13 a.m. UTC
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.

---
 libavformat/utils.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Michael Niedermayer Sept. 14, 2016, 1:51 p.m. UTC | #1
On Wed, Sep 14, 2016 at 04:13:45PM +0800, Xinzheng Zhang wrote:
> 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.
> 
> ---
>  libavformat/utils.c | 1 +
>  1 file changed, 1 insertion(+)

applied

thanks

[...]
diff mbox

Patch

diff --git a/libavformat/utils.c b/libavformat/utils.c
index daf2d5b..6aedb5d 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2412,6 +2412,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,