[vlc-devel] [RFC PATCH 1/5] decoder: fix deadlock when deleting a paused decoder

Thomas Guillem thomas at gllm.fr
Sat Nov 7 14:22:49 CET 2015



On Fri, Nov 6, 2015, at 17:34, Rémi Denis-Courmont wrote:
> On Friday 06 November 2015 14:48:43 Thomas Guillem wrote:
> > ---
> >  src/input/decoder.c | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> > 
> > diff --git a/src/input/decoder.c b/src/input/decoder.c
> > index 5f7cc01..daf4479 100644
> > --- a/src/input/decoder.c
> > +++ b/src/input/decoder.c
> > @@ -1829,9 +1829,13 @@ void input_DecoderDelete( decoder_t *p_dec )
> > 
> >      vlc_cancel( p_owner->thread );
> > 
> > +    vlc_fifo_Lock( p_owner->p_fifo );
> > +    p_owner->paused = false;
> > +    vlc_fifo_Signal( p_owner->p_fifo );
> > +    vlc_fifo_Unlock( p_owner->p_fifo );
> > +
> 
> The thread is already canceled by this point. If it ever waited on the
> FIFO 
> condition variable, it would terminate. So this looks like a no-op to me.

Yes, right.
I have switched between libav and ffmpeg during my tests and have
confused with a deadlock in last ffmpeg with mt, but this is an other
topic.

> 
> In fact, I cannot reproduce any deadlock when stopping during pause.
> 
> >      /* Make sure we aren't paused/waiting/decoding anymore */
> >      vlc_mutex_lock( &p_owner->lock );
> > -    p_owner->paused = false;
> 
> This part seems correct.
> 
> >      p_owner->b_waiting = false;
> >      p_owner->b_flushing = true;
> >      vlc_cond_signal( &p_owner->wait_request );
> 
> -- 
> 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