From 8a50105fe0568598ef5bc0f5360d60536a8bf5cd Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 3 Oct 2008 15:16:26 +0200 Subject: if a volume or channel map is invalid show so when printing it --- src/pulse/volume.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/pulse/volume.c') diff --git a/src/pulse/volume.c b/src/pulse/volume.c index 6907dc83..60a86beb 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++) { -- cgit