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

Steve Lhomme robux4 at ycbcr.xyz
Wed Sep 4 12:47:13 CEST 2019


On 2019-09-04 12:43, Thomas Guillem wrote:
> I think you missed that part:

Yes. This is not nice.

>      /* 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
> _______________________________________________
> 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