[vlc-devel] [RFC PATCH] es_out: Stop decoder wait before flush
Thomas Guillem
thomas at gllm.fr
Tue Nov 10 14:52:44 CET 2015
Naup, this patch is wrong, it mess up with the es_out state.
On Tue, Nov 10, 2015, at 10:46, Ludovic Fauvet wrote:
> On Tue, Nov 10, 2015, at 10:25, Thomas Guillem wrote:
> > Currently, DecoderThread will deadlock in DecoderWaitUnblock if
> > input_DecoderFlush is called while es_out is buffering.
> >
> > A obvious way to fix this deadlock is to stop decoder wait via
> > input_DecoderStopWait before calling input_DecoderFlush.
> > ---
> > src/input/es_out.c | 11 +++++++----
> > 1 file changed, 7 insertions(+), 4 deletions(-)
> >
> > diff --git a/src/input/es_out.c b/src/input/es_out.c
> > index 72dbbde..c94982e 100644
> > --- a/src/input/es_out.c
> > +++ b/src/input/es_out.c
> > @@ -579,13 +579,16 @@ static void EsOutChangePosition( es_out_t *out )
> >
> > if( p_es->p_dec != NULL )
> > {
> > - input_DecoderFlush( p_es->p_dec );
> > - if( !p_sys->b_buffering )
> > + if( p_sys->b_buffering )
> > {
> > - input_DecoderStartWait( p_es->p_dec );
> > + input_DecoderStopWait( p_es->p_dec );
> > if( p_es->p_dec_record != NULL )
> > - input_DecoderStartWait( p_es->p_dec_record );
> > + input_DecoderStopWait( p_es->p_dec_record );
> > }
> > + input_DecoderFlush( p_es->p_dec );
> > + input_DecoderStartWait( p_es->p_dec );
> > + if( p_es->p_dec_record != NULL )
> > + input_DecoderStartWait( p_es->p_dec_record );
> > }
> > }
> >
> > --
> > 2.1.4
>
> Tested, it fixes the aforementioned deadlock.
>
> --
> Ludovic Fauvet
> www.videolan.org
> _______________________________________________
> 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