summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-08-19 23:30:27 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-08-26 22:15:18 +0200
commite6a045ba561adf9597767fa96264429b66609b81 (patch)
tree640ac7995470c8e26ba0f7055037986e10f39e48
parentcebbaf578d9bb68aeea969d7768aea062afa8aea (diff)
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@gmx.at>
-rw-r--r--libavformat/nutdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index ba3eb859f2..3389c79ba9 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;