diff options
author | Lennart Poettering <lennart@poettering.net> | 2008-10-03 15:16:26 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2008-10-03 15:16:26 +0200 |
commit | 8a50105fe0568598ef5bc0f5360d60536a8bf5cd (patch) | |
tree | c26c4a70fd57c38f7f6037c2aaa8965c3e4a2c9a /src/pulse/volume.c | |
parent | 33b186e74dc2de6fa363d10d3450c354ec99f864 (diff) |
if a volume or channel map is invalid show so when printing it
Diffstat (limited to 'src/pulse/volume.c')
-rw-r--r-- | src/pulse/volume.c | 8 |
1 files changed, 8 insertions, 0 deletions
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 <stdio.h> #include <string.h> +#include <pulse/i18n.h> #include <pulsecore/core-util.h> #include <pulsecore/macro.h> @@ -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++) { |