]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Make sure that video frames are flushed at EOF.
authormichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sun, 19 Apr 2009 20:24:44 +0000 (20:24 +0000)
committermichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sun, 19 Apr 2009 20:24:44 +0000 (20:24 +0000)
This should fix a regression.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18624 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

ffplay.c

index fb053860a1b2dd2e313f70f15bc34c5e1091e338..6984ff8ecfb55524ea340590ea583fb8eef74151 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -1919,6 +1919,7 @@ static int decode_thread(void *arg)
     int err, i, ret, video_index, audio_index, subtitle_index;
     AVPacket pkt1, *pkt = &pkt1;
     AVFormatParameters params, *ap = &params;
+    int eof=0;
 
     video_index = -1;
     audio_index = -1;
@@ -2072,7 +2073,7 @@ static int decode_thread(void *arg)
             SDL_Delay(10);
             continue;
         }
-        if(url_feof(ic->pb)) {
+        if(url_feof(ic->pb) || eof) {
             av_init_packet(pkt);
             pkt->data=NULL;
             pkt->size=0;
@@ -2082,11 +2083,12 @@ static int decode_thread(void *arg)
         }
         ret = av_read_frame(ic, pkt);
         if (ret < 0) {
-            if (ret != AVERROR_EOF && url_ferror(ic->pb) == 0) {
-                SDL_Delay(100); /* wait for user event */
-                continue;
-            } else
+            if (ret == AVERROR_EOF)
+                eof=1;
+            if (url_ferror(ic->pb))
                 break;
+            SDL_Delay(100); /* wait for user event */
+            continue;
         }
         if (pkt->stream_index == is->audio_stream) {
             packet_queue_put(&is->audioq, pkt);