[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] main: set LC_NUMERIC to C
Arun Raghavan
gitlab at gitlab.freedesktop.org
Mon Nov 23 21:43:16 UTC 2020
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20201123/d9fb6926/attachment.htm>
More information about the pulseaudio-commits
mailing list