[vlc-devel] [PATCH 11/11] decoder: make the get_device callback mandatory

Steve Lhomme robux4 at ycbcr.xyz
Tue Nov 5 16:03:16 CET 2019


On 2019-11-05 15:40, Steve Lhomme wrote:
> On 2019-11-05 14:56, Thomas Guillem wrote:
>>
>>
>> On Mon, Nov 4, 2019, at 13:05, Steve Lhomme wrote:
>>> Even if it gives a NULL decoder device at least we tried.
>>> ---
>>>   include/vlc_codec.h | 3 ---
>>>   1 file changed, 3 deletions(-)
>>>
>>> diff --git a/include/vlc_codec.h b/include/vlc_codec.h
>>> index e73ad16f393..274de068014 100644
>>> --- a/include/vlc_codec.h
>>> +++ b/include/vlc_codec.h
>>> @@ -279,9 +279,6 @@ static inline vlc_decoder_device *
>>> decoder_GetDecoderDevice( decoder_t *dec )
>>>       if ( unlikely(dec->fmt_in.i_cat != VIDEO_ES || dec->cbs == NULL 
>>> ) )
>>>           return NULL;
>>> -    if ( dec->cbs->video.get_device == NULL )
>>> -        return NULL; /* TODO make it mandatory for all decoder 
>>> owners */
>>
>> You should add an assert then.
> 
> This is in a header, adding asserts in headers is usually not good. 
> Also, once this test will be removed (patch pending) it will crash on 
> the following line.

I added a vlc_assert() which is suited for VLC headers.

>>> -
>>>       return dec->cbs->video.get_device( dec );
>>>   }
>>> -- 
>>> 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
>>
> _______________________________________________
> 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