[vlc-devel] [vlc-commits] vout/caopengllayer: Fallback to legacy vout on < 10.14

Marvin Scholz epirat07 at gmail.com
Sun Mar 22 14:01:08 CET 2020



On 22 Mar 2020, at 12:52, Felix Paul Kühne wrote:

> Hi,
>
>> On 21. Mar 2020, at 21:21, Marvin Scholz <git at videolan.org> wrote:
>>
>> vlc/vlc-3.0 | branch: master | Marvin Scholz <epirat07 at gmail.com> | 
>> Mon Mar  2 12:23:52 2020 +0100| 
>> [2272cd45c0b5bde35388399c838d29bd78e018be] | committer: Marvin Scholz
>>
>> vout/caopengllayer: Fallback to legacy vout on < 10.14
>>
>>> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=2272cd45c0b5bde35388399c838d29bd78e018be
>> ---
>>
>> modules/video_output/caopengllayer.m | 12 ++++++++++++
>> 1 file changed, 12 insertions(+)
>>
>> diff --git a/modules/video_output/caopengllayer.m 
>> b/modules/video_output/caopengllayer.m
>> index 629124150b..de363bd3a4 100644
>> --- a/modules/video_output/caopengllayer.m
>> +++ b/modules/video_output/caopengllayer.m
>> @@ -272,6 +272,18 @@ static int Open(vlc_object_t *this)
>>         if (sys == NULL)
>>             return VLC_ENOMEM;
>>
>> +        // Only use this video output on macOS 10.14 or higher
>> +        // currently, as it has some issues on at least macOS 10.7
>> +        // and the old NSView based output still works fine on old
>> +        // macOS versions.
>> +        if (@available(macOS 10.14, *)) {
>> +            // This is intentionally left empty, as the check
>> +            // can not be negated or combined with other conditions!
>> +        } else {
>> +            if (!vd->obj.force)
>> +                return VLC_EGENERIC;
>> +        }
>> +
>
> Why not use (NSAppKitVersionNumber >= 1639.10) to detect macOS 10.14 
> and thereby simplify this check?

Because if (@available(macOS 10.14, *)) { is actually readable and
easy to change in the future, (NSAppKitVersionNumber >= 1639.10) not so 
much.
Additionally there seemed to be some special case for 10.10 
(NSAppKitVersionNumber10_10_Max)
and I was not sure if it was safe to just do NSAppKitVersionNumber < 
1639.10 or if
it would match incorrectly for some OSes…

I do not have strong opinions about this, so if you want to change it, 
feel
free to do so.

For 4.x we can just use isOperatingSystemAtLeastVersion: for this, which 
is both
readable and easy to use.

>
> Best regards,
>
> Felix
> _______________________________________________
> 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