From 64e9372874ec3c055de2f0cfb64e260a61e8a834 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 14 Nov 2005 09:50:29 +0000 Subject: [PATCH] pcm_ladspa - fix locale issues See bug#1553 for more details. --- src/pcm/pcm_ladspa.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/pcm/pcm_ladspa.c b/src/pcm/pcm_ladspa.c index 8fe204a9..dd415499 100644 --- a/src/pcm/pcm_ladspa.c +++ b/src/pcm/pcm_ladspa.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "pcm_local.h" #include "pcm_plugin.h" @@ -726,8 +727,28 @@ static int snd_pcm_ladspa_check_file(snd_pcm_ladspa_plugin_t * const plugin, long idx; const LADSPA_Descriptor *d; for (idx = 0; (d = fcn(idx)) != NULL; idx++) { +/* + * avoid locale problems - see ALSA bug#1553 + */ +#if 0 if (strcmp(label, d->Label)) continue; +#else + char *labellocale; + struct lconv *lc; + lc = localeconv (); + labellocale = malloc (strlen (label) + 1); + if (labellocale == NULL) + return -ENOMEM; + strcpy (labellocale, label); + if (strrchr(labellocale, '.')) + *strrchr (labellocale, '.') = *lc->decimal_point; + if (strcmp(label, d->Label) && strcmp(labellocale, d->Label)) { + free(labellocale); + continue; + } + free (labellocale); +#endif if (ladspa_id > 0 && d->UniqueID != ladspa_id) continue; plugin->filename = strdup(filename); -- 2.47.1