]> git.sesse.net Git - ffmpeg/commitdiff
ffplay: fix autoexit doesn't work in the case of pb->error
authorZhao Zhili <quinkblack@foxmail.com>
Wed, 26 Aug 2020 16:44:56 +0000 (00:44 +0800)
committerMarton Balint <cus@passwd.hu>
Tue, 8 Sep 2020 17:59:17 +0000 (19:59 +0200)
Signed-off-by: Marton Balint <cus@passwd.hu>
fftools/ffplay.c

index 6c9c041e9a561a1aa4cc94f1db4b71df70fb89df..9ff0425163ec3718c218adb01e40f1042510537f 100644 (file)
@@ -3028,8 +3028,12 @@ static int read_thread(void *arg)
                     packet_queue_put_nullpacket(&is->subtitleq, is->subtitle_stream);
                 is->eof = 1;
             }
-            if (ic->pb && ic->pb->error)
-                break;
+            if (ic->pb && ic->pb->error) {
+                if (autoexit)
+                    goto fail;
+                else
+                    break;
+            }
             SDL_LockMutex(wait_mutex);
             SDL_CondWaitTimeout(is->continue_read_thread, wait_mutex, 10);
             SDL_UnlockMutex(wait_mutex);