]> git.sesse.net Git - vlc/commitdiff
avcodec: mark get_buffer thread safe
authorRémi Denis-Courmont <remi@remlab.net>
Tue, 11 Jun 2013 16:43:25 +0000 (19:43 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 24 Jun 2013 17:07:06 +0000 (20:07 +0300)
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.

modules/codec/avcodec/video.c

index 7f5b8abb936d48f1d54d43606902f7db3a23f7a4..5338144c385e2e4a42ee9820497d842e34f4366a 100644 (file)
@@ -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 */