[vlc-devel] [PATCH] decoder: flush the vout before flushing the decoder

Thomas Guillem thomas at gllm.fr
Mon Nov 30 11:41:25 CET 2015



On Mon, Nov 30, 2015, at 11:20, Rémi Denis-Courmont wrote:
> Le 2015-11-30 11:25, Thomas Guillem a écrit :
> > ---
> >  src/input/decoder.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/src/input/decoder.c b/src/input/decoder.c
> > index 0f08198..c25a130 100644
> > --- a/src/input/decoder.c
> > +++ b/src/input/decoder.c
> > @@ -1278,6 +1278,10 @@ static void DecoderProcessFlush( decoder_t 
> > *p_dec )
> >      if( p_packetizer != NULL && p_packetizer->pf_flush != NULL )
> >          p_packetizer->pf_flush( p_packetizer );
> >
> > +    /* see vout_Flush comment in input_DecoderDelete() */
> 
> Uh? How? If the decoder gets stuck decoding as in that comment, then 
> this code cannot be reached until the decoder gets unstuck. So that 
> seems like a catch-22. AFAIK, if the decoder locks up, then the only 
> avenue of recovery is to stop.

Oh, yes this patch works only if decoder module wait for a new picture
from an other thread.

As a better fix, I could put the following at the end of
input_DecoderFlush

vlc_mutex_lock( &p_owner->lock );
/* see vout_Flush comment in input_DecoderDelete() */
if( p_owner->p_vout )
    vout_Flush( p_owner->p_vout, VLC_TS_INVALID+1 );
vlc_mutex_unlock( &p_owner->lock );


> 
> If alternatively the decoder gets stuck flushing, then either the 
> decoder plug-in:
> - has a bug,
> - needs to cancel pending picture allocations *within* pf_flush, or

Or add decoder_abortPicture called from pf_flush to cancel thread
waiting for a picture as I said in a previous mail.

> - both.
> 
> So overall, I don't understand this patch.
> 
> > +    if( p_owner->p_vout )
> > +        vout_Flush( p_owner->p_vout, VLC_TS_INVALID+1 );
> > +
> >      if ( p_dec->pf_flush != NULL )
> >          p_dec->pf_flush( p_dec );
> >      else
> 
> -- 
> 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