[vlc-devel] [PATCH] input: don't wait data to create sout input

Rémi Denis-Courmont remi at remlab.net
Tue Jan 30 19:02:58 CET 2018


Le tiistaina 30. tammikuuta 2018, 0.02.00 EET Francois Cartegnie a écrit :
> No sout mux buffer parameters is sufficient
> as spu can arrive really late.
> ---
>  src/input/decoder.c | 20 ++++++++++++++++++--
>  1 file changed, 18 insertions(+), 2 deletions(-)
> 
> diff --git a/src/input/decoder.c b/src/input/decoder.c
> index 0d3df97934..6a9a4fcb06 100644
> --- a/src/input/decoder.c
> +++ b/src/input/decoder.c
> @@ -1953,8 +1953,24 @@ decoder_t *input_DecoderNew( input_thread_t *p_input,
> es_format_t *fmt, input_clock_t *p_clock, sout_instance_t *p_sout  )
>  {
> -    return decoder_New( VLC_OBJECT(p_input), p_input, fmt, p_clock,
> -                        input_priv(p_input)->p_resource, p_sout );
> +    decoder_t *p_dec = decoder_New( VLC_OBJECT(p_input), p_input, fmt,
> p_clock, +                                   
> input_priv(p_input)->p_resource, p_sout ); +#ifdef ENABLE_SOUT
> +    /* Do not delay sout creation for SPU or DATA. */
> +    if( p_dec && p_sout && fmt->b_packetized &&
> +        (fmt->i_cat != VIDEO_ES && fmt->i_cat != AUDIO_ES) )
> +    {
> +        decoder_owner_sys_t *p_owner = p_dec->p_owner;
> +        p_owner->p_sout_input = sout_InputNew( p_owner->p_sout, fmt );
> +        if( p_owner->p_sout_input == NULL )
> +        {
> +            msg_Err( p_dec, "cannot create sout input (%4.4s)",
> +                     (char *)&fmt->i_codec );
> +            p_owner->error = true;
> +        }
> +    }
> +#endif
> +    return p_dec;
>  }
> 
>  /**

I´d argue that this logically belongs in decoder_Create(), even though it 
makes no practical difference.

It is also questionable why not to do for all ES categories. Stream output 
generally wants to know the list of ES as early as possible.

-- 
雷米‧德尼-库尔蒙
https://www.remlab.net/



More information about the vlc-devel mailing list