Arun Raghavan pushed to branch master at PulseAudio / pulseaudio


Commits:
d5d08035 by Tanu Kaskinen at 2020-11-23T21:37:57+00:00
main: set LC_NUMERIC to C

The webrtc backend of module-echo-cancel uses sscanf() to parse floating
point numbers from module arguments, which didn't work when the locale
used a comma for the decimal point. Setting the LC_NUMERIC locale
variable to C makes the pulseaudio process use a period as the decimal
point regardless of the user's locale configuration.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/89

- - - - -


1 changed file:

- src/daemon/main.c


Changes:

=====================================
src/daemon/main.c
=====================================
@@ -480,7 +480,13 @@ int main(int argc, char *argv[]) {
     pa_unblock_sigs(-1);
     pa_reset_priority();
 
+    /* Load locale from the environment. */
     setlocale(LC_ALL, "");
+
+    /* Set LC_NUMERIC to C so that floating point strings are consistently
+     * formatted and parsed across locales. */
+    setlocale(LC_NUMERIC, "C");
+
     pa_init_i18n();
 
     conf = pa_daemon_conf_new();



View it on GitLab: 
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/d5d08035913be89ad0dec99b4759ab9377bc1eea

-- 
View it on GitLab: 
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/d5d08035913be89ad0dec99b4759ab9377bc1eea
You're receiving this email because of your account on gitlab.freedesktop.org.


_______________________________________________
pulseaudio-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-commits

Reply via email to