[vlc-commits] avcodec: mark get_buffer thread safe

Rémi Denis-Courmont git at videolan.org
Mon Jun 24 19:13:23 CEST 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Jun 11 19:43:25 2013 +0300| [9ba5f88e6ad394ade24da679f62d5247e2116dd2] | committer: Rémi Denis-Courmont

avcodec: mark get_buffer thread safe

In libavcodec, thread-safe callback merely means callback that can run
on any thread. It does not imply that the codec should be re-entrant.
In other words, it boils down to not using thread-specific variables.

The VLC get_buffer callback is not reentrant currently, but it does not
care which thread it runs on.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9ba5f88e6ad394ade24da679f62d5247e2116dd2
---

 modules/codec/avcodec/video.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 7f5b8ab..5338144 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -335,6 +335,7 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
     if( i_codec_id == AV_CODEC_ID_MPEG4 )
         p_sys->p_context->thread_count = 1;
 
+    p_sys->p_context->thread_safe_callbacks = true;
 #endif
 
     char *hw = var_CreateGetString( p_dec, "avcodec-hw" ); /* FIXME */



More information about the vlc-commits mailing list