From e6a045ba561adf9597767fa96264429b66609b81 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 19 Aug 2012 23:30:27 +0200 Subject: [PATCH] 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 --- libavformat/nutdec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index ba3eb859f2..3389c79ba9 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -950,6 +950,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;