[vlc-devel] [PATCH] decoder: empty the input fifo on delete
Thomas Guillem
thomas at gllm.fr
Wed Sep 2 12:45:13 CEST 2015
On Wed, Sep 2, 2015, at 12:31, Rémi Denis-Courmont wrote:
> 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).
On android with MediaCodec when input_DecoderDelete is called,
DecoderProcess continue to be called with valid blocks for around 30
times. The decoder continue to output valid frames but they are dropped
since It can't create a new picture_t.
Is this linked to the android cancel issue ? The DecoderThread should be
terminated after vlc_restorecancel( canc ), no ?
>
> > ---
> > 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/
> _______________________________________________
> 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