[FFmpeg-cvslog] nutdec: Flip the direction for seeking with an index in the failure case.
Michael Niedermayer
git at videolan.org
Sun Aug 26 22:22:19 CEST 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Aug 19 23:30:27 2012 +0200| [e6a045ba561adf9597767fa96264429b66609b81] | committer: Michael Niedermayer
nutdec: Flip the direction for seeking with an index in the failure case.
This is closer to how seeking works without an index
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e6a045ba561adf9597767fa96264429b66609b81
---
libavformat/nutdec.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index ba3eb85..3389c79 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -951,6 +951,8 @@ static int read_seek(AVFormatContext *s, int stream_index,
if (st->index_entries) {
int index = av_index_search_timestamp(st, pts, flags);
if (index < 0)
+ index = av_index_search_timestamp(st, pts, flags ^ AVSEEK_FLAG_BACKWARD);
+ if (index < 0)
return -1;
pos2 = st->index_entries[index].pos;
More information about the ffmpeg-cvslog
mailing list