[vlc-devel] [RFC PATCH 2/5] decoder: frames_countdown is only for Video

Rémi Denis-Courmont remi at remlab.net
Fri Nov 6 17:37:10 CET 2015


On Friday 06 November 2015 14:48:44 Thomas Guillem wrote:
> ---
>  src/input/decoder.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/src/input/decoder.c b/src/input/decoder.c
> index daf4479..c89b49a 100644
> --- a/src/input/decoder.c
> +++ b/src/input/decoder.c
> @@ -2134,10 +2134,13 @@ void input_DecoderFrameNext( decoder_t *p_dec,
> mtime_t *pi_duration ) assert( p_owner->paused );
>      *pi_duration = 0;
> 
> -    vlc_fifo_Lock( p_owner->p_fifo );
> -    p_owner->frames_countdown++;
> -    vlc_fifo_Signal( p_owner->p_fifo );
> -    vlc_fifo_Unlock( p_owner->p_fifo );
> +    if( p_owner->fmt.i_cat == VIDEO_ES )

Missing owner lock, no?

As far as  I can tell, this is non-obviously useless. The value will be 
ignored in non-VIDEO cases (and overflowing is safe). This might agreeably 
have deserved a comment though.

> +    {
> +        vlc_fifo_Lock( p_owner->p_fifo );
> +        p_owner->frames_countdown++;
> +        vlc_fifo_Signal( p_owner->p_fifo );
> +        vlc_fifo_Unlock( p_owner->p_fifo );
> +    }
> 
>      vlc_mutex_lock( &p_owner->lock );
>      if( p_owner->fmt.i_cat == VIDEO_ES )

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list