[vlc-devel] [PATCH] decoder: don't return a decoder owner if loading the decoder fails

Thomas Guillem thomas at gllm.fr
Wed Sep 4 12:43:51 CEST 2019


I think you missed that part:

    /* Create the decoder configuration structure */
    struct decoder_owner *p_owner = CreateDecoder( p_parent, fmt, p_clock, p_resource, p_sout,
                           thumbnailing, cbs, userdata );
    if( p_owner == NULL )
    {
        msg_Err( p_parent, "could not create %s", psz_type );
        vlc_dialog_display_error( p_parent, _("Streaming / Transcoding failed"),
            _("VLC could not open the %s module."), vlc_gettext( psz_type ) );
        return NULL;
    }

    decoder_t *p_dec = &p_owner->dec;
    if( !p_dec->p_module )
    {
        DecoderUnsupportedCodec( p_dec, fmt, !p_sout );

        DeleteDecoder( p_dec );
        return NULL;
    }

On Wed, Sep 4, 2019, at 12:19, Steve Lhomme wrote:
> ---
>  src/input/decoder.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/input/decoder.c b/src/input/decoder.c
> index b208eba2628..697feb147c7 100644
> --- a/src/input/decoder.c
> +++ b/src/input/decoder.c
> @@ -1868,7 +1868,7 @@ static struct decoder_owner * CreateDecoder( 
> vlc_object_t *p_parent,
>  
>      /* Find a suitable decoder/packetizer module */
>      if( LoadDecoder( p_dec, p_sout != NULL, fmt ) )
> -        return p_owner;
> +        return NULL;
>  
>      assert( p_dec->fmt_in.i_cat == p_dec->fmt_out.i_cat && fmt->i_cat 
> == p_dec->fmt_in.i_cat);
>  
> -- 
> 2.17.1
> 
> _______________________________________________
> 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