[vlc-devel] [PATCH 09/18] adaptive:fakeES: initialize the ES from the source category
Steve Lhomme
robux4 at gmail.com
Sun Jul 9 08:20:54 CEST 2017
On Sat, Jul 8, 2017 at 9:02 PM, Francois Cartegnie <fcvlcdev at free.fr> wrote:
> Le 08/07/2017 à 19:21, Rémi Denis-Courmont a écrit :
>>>> _______________________________________________
>>>> vlc-devel mailing list
>>>> To unsubscribe or modify your subscription options:
>>>> https://mailman.videolan.org/listinfo/vlc-devel
>>>
>>> That's it, I explained why 0 is not a good value.
>>> _______________________________________________
>>> vlc-devel mailing list
>>> To unsubscribe or modify your subscription options:
>>> https://mailman.videolan.org/listinfo/vlc-devel
>>
>> What does that have to do with my comment about the call being entirely useless ?
>>
>
> What's the problem with using proper initializers, even
> if they currently do nothing ?
This patches (and another similar one) address the typing/values
consistency, not the design of the whole thing.
If you wanna go down that road there are other places where the init
is done and a copy done afterwards (es_format_InitFromVideo for
example).
Initializing something with a value when you know it's wrong is not
good coding practice.
The cases where es_format_Init are called with a legitimate UNKNOWN_ES
values should be left to the narrow cases where it makes sense. Given
the union we have now, we can't afford to let the rest of the code
figure out when it should overwrite to a proper value. And since
VIDEO_ES requires to know on init so the field of view is initialized
properly it can only be done on init.
> That's not like someone never changed the es_format in a way a copy from
> a VIDEO_ES to an UNKNOWN_ES would just crash.
>
> Francois
> _______________________________________________
> 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