[FFmpeg-devel] [PATCH 3/3] avformat/async: avoid deadlock on close

Zhang Rui bbcallen at gmail.com
Tue Jul 21 09:46:04 CEST 2015


---
 libavformat/async.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/async.c b/libavformat/async.c
index 1ab28d3..36c86d0 100644
--- a/libavformat/async.c
+++ b/libavformat/async.c
@@ -129,7 +129,8 @@ static void *async_buffer_task(void *arg)
         if (c->io_eof_reached || fifo_space <= 0) {
             pthread_mutex_lock(&c->mutex);
             pthread_cond_signal(&c->cond_wakeup_main);
-            pthread_cond_wait(&c->cond_wakeup_background, &c->mutex);
+            if (!async_interrupt_callback(h))
+                pthread_cond_wait(&c->cond_wakeup_background, &c->mutex);
             pthread_mutex_unlock(&c->mutex);
             continue;
         }
-- 
2.0.0



More information about the ffmpeg-devel mailing list