diff --git a/src/pulse/channelmap.c b/src/pulse/channelmap.c index 373087515..db6577ed4 100644 --- a/src/pulse/channelmap.c +++ b/src/pulse/channelmap.c @@ -466,6 +466,13 @@ char* pa_channel_map_snprint(char *s, size_t l, const pa_channel_map *map) { pa_assert(l > 0); pa_assert(map); + pa_init_i18n(); + + if (!pa_channel_map_valid(map)) { + pa_snprintf(s, l, _("(invalid)")); + return s; + } + *(e = s) = 0; for (channel = 0; channel < map->channels && l > 1; channel++) { diff --git a/src/pulse/sample.c b/src/pulse/sample.c index 93da2465f..39891d255 100644 --- a/src/pulse/sample.c +++ b/src/pulse/sample.c @@ -131,7 +131,7 @@ char *pa_sample_spec_snprint(char *s, size_t l, const pa_sample_spec *spec) { pa_init_i18n(); if (!pa_sample_spec_valid(spec)) - pa_snprintf(s, l, _("Invalid")); + pa_snprintf(s, l, _("(invalid)")); else pa_snprintf(s, l, "%s %uch %uHz", pa_sample_format_to_string(spec->format), spec->channels, spec->rate); diff --git a/src/pulse/volume.c b/src/pulse/volume.c index 6907dc83e..60a86bebc 100644 --- a/src/pulse/volume.c +++ b/src/pulse/volume.c @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -134,6 +135,13 @@ char *pa_cvolume_snprint(char *s, size_t l, const pa_cvolume *c) { pa_assert(l > 0); pa_assert(c); + pa_init_i18n(); + + if (!pa_cvolume_valid(c)) { + pa_snprintf(s, l, _("(invalid)")); + return s; + } + *(e = s) = 0; for (channel = 0; channel < c->channels && l > 1; channel++) {