mpc: fix seeking to the end
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 27 Aug 2012 03:01:51 +0000 (05:01 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 27 Aug 2012 03:23:42 +0000 (05:23 +0200)
Fixes Ticket1689

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/mpc.c

index 2ca8dfa..3b818ed 100644 (file)
@@ -198,7 +198,7 @@ static int mpc_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
     uint32_t lastframe;
 
     /* if found, seek there */
-    if (index >= 0){
+    if (index >= 0 && st->index_entries[st->nb_index_entries-1].timestamp >= timestamp - DELAY_FRAMES){
         c->curframe = st->index_entries[index].pos;
         return 0;
     }