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

Steve Lhomme robux4 at ycbcr.xyz
Fri Jun 26 13:43:36 CEST 2020


LGTM

You may also move the p_vout reading inside the lock in 
ModuleThread_PlayVideo().

On 2020-06-26 13:26, Thomas Guillem wrote:
> 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
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
> 


More information about the vlc-devel mailing list