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

Steve Lhomme robux4 at ycbcr.xyz
Thu Mar 5 10:09:37 CET 2020


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.

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
> 


More information about the vlc-devel mailing list