[vlc-devel] [PATCH 1/2] decoder: lock vout_thread_started when written

Thomas Guillem thomas at gllm.fr
Fri Jun 26 13:26:01 CEST 2020


This variable is written from the ModuleThread or from the DecoderThread when
the module is unloaded. The lock need to be held when this variable is written,
since the DecoderThread read it with the lock held.
---
 src/input/decoder.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 0c216bfca49..dd901f77b0c 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -479,7 +479,9 @@ static int ModuleThread_UpdateVideoFormat( decoder_t *p_dec, vlc_video_context *
     res = input_resource_StartVout( p_owner->p_resource, vctx, &cfg);
     if (res == 0)
     {
+        vlc_mutex_lock( &p_owner->lock );
         p_owner->vout_thread_started = true;
+        vlc_mutex_unlock( &p_owner->lock );
         decoder_Notify(p_owner, on_vout_started, p_vout, vout_order);
     }
     return res;
-- 
2.20.1



More information about the vlc-devel mailing list