[vlc-devel] [PATCH 1/2] macosx: remove support for the language argument

Steve Lhomme robux4 at ycbcr.xyz
Thu Mar 5 10:45:27 CET 2020


On 2020-03-05 10:35, Marvin Scholz wrote:
> 
> 
> On 5 Mar 2020, at 10:09, Steve Lhomme wrote:
> 
>> You should mention that it's deprecated since 2.1 and update 
>> libvlc-module.c no define the variable anymore on Mac.
>>
>> It seems the variable isn't handled on Windows either, so removing the 
>> variable altogether would be OK too.
> 
> I thought the variables have to stay to not break the CLI?

I think it's OK to remove CLI options deprecated in 2.x in VLC 4.0. But 
that's just me.
At some point it would be good to let people know some options don't 
work anymore and what they are expecting from VLC is not doing what they 
want.

>>
>> On 2020-03-04 16:24, Marvin Scholz wrote:
>>> ---
>>>   bin/darwinvlc.m | 37 +++++++++++--------------------------
>>>   1 file changed, 11 insertions(+), 26 deletions(-)
>>>
>>> diff --git a/bin/darwinvlc.m b/bin/darwinvlc.m
>>> index 7ddbdd19fd..fbefc316a6 100644
>>> --- a/bin/darwinvlc.m
>>> +++ b/bin/darwinvlc.m
>>> @@ -229,33 +229,18 @@ int main(int i_argc, const char *ppsz_argv[])
>>>       /* overwrite system language on Mac */
>>>       char *lang = NULL;
>>>  -    for (int i = 0; i < i_argc; i++) {
>>> -        if (!strncmp(ppsz_argv[i], "--language", 10)) {
>>> -            lang = strstr(ppsz_argv[i], "=");
>>> -            ppsz_argv++, i_argc--;
>>> -            continue;
>>> -        }
>>> -    }
>>> -    if (lang && strncmp( lang, "auto", 4 )) {
>>> -        char tmp[11];
>>> -        snprintf(tmp, 11, "LANG%s", lang);
>>> -        putenv(tmp);
>>> -    }
>>> -
>>> -    if (!lang) {
>>> -        CFStringRef language;
>>> -        language = 
>>> (CFStringRef)CFPreferencesCopyAppValue(CFSTR("language"),
>>> - kCFPreferencesCurrentApplication);
>>> -        if (language) {
>>> -            lang = FromCFString(language, kCFStringEncodingUTF8);
>>> -            if (strncmp( lang, "auto", 4 )) {
>>> -                char tmp[11];
>>> -                snprintf(tmp, 11, "LANG=%s", lang);
>>> -                putenv(tmp);
>>> -            }
>>> -            free(lang);
>>> -            CFRelease(language);
>>> +    CFStringRef language;
>>> +    language = 
>>> (CFStringRef)CFPreferencesCopyAppValue(CFSTR("language"),
>>> + kCFPreferencesCurrentApplication);
>>> +    if (language) {
>>> +        lang = FromCFString(language, kCFStringEncodingUTF8);
>>> +        if (strncmp( lang, "auto", 4 )) {
>>> +            char tmp[11];
>>> +            snprintf(tmp, 11, "LANG=%s", lang);
>>> +            putenv(tmp);
>>>           }
>>> +        free(lang);
>>> +        CFRelease(language);
>>>       }
>>>        ppsz_argv++; i_argc--; /* skip executable path */
>>> -- 
>>> 2.21.1 (Apple Git-122.3)
>>>
>>> _______________________________________________
>>> 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