[vlc-devel] [RFC PATCH 2/3] decoder: merge locks and conds

Rémi Denis-Courmont remi at remlab.net
Wed Apr 1 16:34:33 CEST 2015


Le 2015-04-01 17:13, Thomas Guillem a écrit :
> ---
>  src/input/decoder.c | 148
> ++++++++++++++++++++++++++++------------------------
>  1 file changed, 79 insertions(+), 69 deletions(-)
>
> diff --git a/src/input/decoder.c b/src/input/decoder.c
> index 76c4038..1fd5b90 100644
> --- a/src/input/decoder.c
> +++ b/src/input/decoder.c
> @@ -87,9 +87,7 @@ struct decoder_owner_sys_t
>
>      /* Lock for communication with decoder thread */
>      vlc_mutex_t lock;
> -    vlc_cond_t  wait_request;
> -    vlc_cond_t  wait_acknowledge;
> -    vlc_cond_t  wait_fifo; /* TODO: merge with wait_acknowledge */
> +    vlc_cond_t  wait;
>
>      /* -- These variables need locking on write(only) -- */
>      audio_output_t *p_aout;
> @@ -209,15 +207,17 @@ static int aout_update_format( decoder_t *p_dec 
> )
>      if( p_owner->p_aout
>       && !AOUT_FMTS_IDENTICAL(&p_dec->fmt_out.audio, 
> &p_owner->fmt.audio) )
>      {
> -        audio_output_t *p_aout = p_owner->p_aout;
> +        audio_output_t *p_aout;
>
>          /* Parameters changed, restart the aout */
> -        vlc_mutex_lock( &p_owner->lock );
>
> -        aout_DecDelete( p_owner->p_aout );
> +        vlc_mutex_lock( &p_owner->lock );
> +        p_aout = p_owner->p_aout;
>          p_owner->p_aout = NULL;
> -
>          vlc_mutex_unlock( &p_owner->lock );
> +
> +        aout_DecDelete( p_aout );
> +

How does this relate to the topic of this patch?

>          input_resource_PutAout( p_owner->p_resource, p_aout );
>      }
>

-- 
Rémi Denis-Courmont



More information about the vlc-devel mailing list