From 3dccd3e066b597dfb668aa8e41672b288a8d648f Mon Sep 17 00:00:00 2001 From: shuanglong.wang Date: Wed, 06 Sep 2017 07:27:13 +0000 Subject: 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 --- 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++) { -- cgit