[vlc-devel] [PATCH] input: decoder: fix audio GET_EMPTY mid stream

Jean-Baptiste Kempf jb at videolan.org
Thu Jun 29 14:06:40 CEST 2017


Not against, but that could would love to have some comment...

On Wed, 28 Jun 2017, at 19:06, Francois Cartegnie wrote:
> When the demuxer does not reach EOS, the decoders
> are not drained and GET_EMPTY can't succeed for
> audio as it is in idle/fifo wait state.
> Note: The caller knows the fifo won't receive any
> further data until GET_EMPTY succeeds.
> 
> refs #18463
> ---
>  src/input/decoder.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/src/input/decoder.c b/src/input/decoder.c
> index 0a96c04..73c7a29 100644
> --- a/src/input/decoder.c
> +++ b/src/input/decoder.c
> @@ -2092,7 +2092,16 @@ bool input_DecoderIsEmpty( decoder_t * p_dec )
>      if( p_owner->fmt.i_cat == VIDEO_ES && p_owner->p_vout != NULL )
>          b_empty = vout_IsEmpty( p_owner->p_vout );
>      else if( p_owner->fmt.i_cat == AUDIO_ES )
> +    {
>          b_empty = atomic_load( &p_owner->drained );
> +        if( !b_empty )
> +        {
> +            vlc_fifo_Lock( p_owner->p_fifo );
> +            if( !p_owner->b_draining )
> +                b_empty |= vlc_fifo_IsEmpty( p_owner->p_fifo );
> +            vlc_fifo_Unlock( p_owner->p_fifo );
> +        }
> +    }
>      else
>          b_empty = true; /* TODO subtitles support */
>      vlc_mutex_unlock( &p_owner->lock );
> -- 
> 2.9.4
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


-- 
Jean-Baptiste Kempf -  President
+33 672 704 734


More information about the vlc-devel mailing list