[FFmpeg-devel] [PATCH v2 07/10] vtenc: check condition after conditional variable unblocks.

kernrj at gmail.com kernrj at gmail.com
Wed Nov 18 19:49:55 CET 2015


From: Rick Kern <kernrj at gmail.com>

Condition was not being verified after conditional variable unblocked.

Signed-off-by: Rick Kern <kernrj at gmail.com>
---
 libavcodec/vtenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/vtenc.c b/libavcodec/vtenc.c
index 7132411..f0d8289 100644
--- a/libavcodec/vtenc.c
+++ b/libavcodec/vtenc.c
@@ -100,7 +100,7 @@ static int vtenc_q_pop(VTEncContext* vtctx, bool wait, CMSampleBufferRef* buf){
         return 0;
     }
 
-    if(!vtctx->q_head && wait){
+    while(!vtctx->q_head && !vtctx->async_error && wait){
         pthread_cond_wait(&vtctx->cv_sample_sent, &vtctx->lock);
     }
 
-- 
2.4.9 (Apple Git-60)



More information about the ffmpeg-devel mailing list