[FFmpeg-devel] [PATCH] ffplay: fix autoexit doesn't work in the case of pb->error
Zhao Zhili
quinkblack at foxmail.com
Wed Aug 26 19:44:56 EEST 2020
---
Goto fail will make ffplay exit immediately. I'm not sure
it is the expected behavior. How about just remove the
check on pb->error so decoders can drain normally?
fftools/ffplay.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/fftools/ffplay.c b/fftools/ffplay.c
index 6c9c041e9a..9ff0425163 100644
--- a/fftools/ffplay.c
+++ b/fftools/ffplay.c
@@ -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);
--
2.25.1
More information about the ffmpeg-devel
mailing list