[vlc-devel] [PATCH] decoder: empty the input fifo on delete

Rémi Denis-Courmont remi at remlab.net
Wed Sep 2 12:31:24 CEST 2015


Le 2015-09-02 13:22, Thomas Guillem a écrit :
> This speeds up decoder termination.

Looks to me that this is actually slower due to contention.

b_flushing is what speeds it up (already).

> ---
>  src/input/decoder.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/src/input/decoder.c b/src/input/decoder.c
> index 25eac79..2926568 100644
> --- a/src/input/decoder.c
> +++ b/src/input/decoder.c
> @@ -1823,6 +1823,12 @@ void input_DecoderDelete( decoder_t *p_dec )
>
>      /* Make sure we aren't paused/waiting/decoding anymore */
>      vlc_mutex_lock( &p_owner->lock );
> +
> +    /* Empty the fifo */
> +    vlc_fifo_Lock( p_owner->p_fifo );
> +    block_ChainRelease( vlc_fifo_DequeueAllUnlocked( p_owner->p_fifo 
> ) );
> +    vlc_fifo_Unlock( p_owner->p_fifo );
> +
>      p_owner->b_paused = false;
>      p_owner->b_waiting = false;
>      p_owner->b_flushing = true;

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


More information about the vlc-devel mailing list