author | shuanglong.wang <shuanglong.wang@amlogic.com> | 2017-09-06 07:27:13 (GMT) |
---|---|---|
committer | shuanglong.wang <shuanglong.wang@amlogic.com> | 2017-09-06 07:27:39 (GMT) |
commit | 3dccd3e066b597dfb668aa8e41672b288a8d648f (patch) | |
tree | cdef50e06d5e456ed32b8f39be4e4433af6bf2f5 | |
parent | b3253b3e61d5d30abc6527d66f3f7af947cae2c0 (diff) | |
download | ffmpeg-3dccd3e066b597dfb668aa8e41672b288a8d648f.zip ffmpeg-3dccd3e066b597dfb668aa8e41672b288a8d648f.tar.gz ffmpeg-3dccd3e066b597dfb668aa8e41672b288a8d648f.tar.bz2 |
external/ffmpeg: do not seek individually when some source of mov seek failed [1/1]
PD# 149551
do not seek individually when some source of mov seek failed
Change-Id: Ie893e47c63ae6d81d6e6015114549b6895eab535
-rw-r--r-- | libavformat/mov.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index cd5627b..55de08d 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -6485,6 +6485,7 @@ static int mov_read_seek(AVFormatContext *s, int stream_index, int64_t sample_ti if (sample < 0) return sample; +reseek: if (mc->seek_individually) { /* adjust seek timestamp to found sample timestamp */ int64_t seek_timestamp = st->index_entries[sample].timestamp; @@ -6499,7 +6500,10 @@ static int mov_read_seek(AVFormatContext *s, int stream_index, int64_t sample_ti continue; timestamp = av_rescale_q(seek_timestamp, s->streams[stream_index]->time_base, st->time_base); - mov_seek_stream(s, st, timestamp, flags); + if (mov_seek_stream(s, st, timestamp, flags) < 0) { + mc->seek_individually = 0; + goto reseek; + } } } else { for (i = 0; i < s->nb_streams; i++) { |