[FFmpeg-cvslog] pthread: make ff_thread_release_buffer idempotent.

Anton Khirnov git at videolan.org
Tue Jan 29 14:24:35 CET 2013


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Fri Dec 28 09:54:29 2012 +0100| [e6b1c3bbe7082c71ea8ee8ac83698c156c9e4838] | committer: Anton Khirnov

pthread: make ff_thread_release_buffer idempotent.

I.e. don't do anything on already released frames.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e6b1c3bbe7082c71ea8ee8ac83698c156c9e4838
---

 libavcodec/pthread.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index 73d9da3..cd44b8c 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -975,6 +975,9 @@ void ff_thread_release_buffer(AVCodecContext *avctx, AVFrame *f)
     PerThreadContext *p = avctx->thread_opaque;
     FrameThreadContext *fctx;
 
+    if (!f->data[0])
+        return;
+
     if (!(avctx->active_thread_type&FF_THREAD_FRAME)) {
         avctx->release_buffer(avctx, f);
         return;



More information about the ffmpeg-cvslog mailing list