avplay: reset decoder flush state when seeking
authorJustin Ruggles <justin.ruggles@gmail.com>
Sat, 4 Feb 2012 22:32:26 +0000 (17:32 -0500)
committerJustin Ruggles <justin.ruggles@gmail.com>
Mon, 6 Feb 2012 18:22:01 +0000 (13:22 -0500)
Fixes seeking after decoder has already been flushed for codecs using
CODEC_CAP_DELAY.

avplay.c

index f20b631..96551a6 100644 (file)
--- a/avplay.c
+++ b/avplay.c
@@ -2114,8 +2114,10 @@ static int audio_decode_frame(VideoState *is, double *pts_ptr)
         if ((new_packet = packet_queue_get(&is->audioq, pkt, 1)) < 0)
             return -1;
 
-        if (pkt->data == flush_pkt.data)
+        if (pkt->data == flush_pkt.data) {
             avcodec_flush_buffers(dec);
+            flush_complete = 0;
+        }
 
         *pkt_temp = *pkt;