summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/SampleWindow.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/SampleWindow.cc b/src/SampleWindow.cc
index 8de15ad..0465ce1 100644
--- a/src/SampleWindow.cc
+++ b/src/SampleWindow.cc
@@ -69,8 +69,11 @@ void SampleWindow::updateInfo(const SampleInfo &i) {
snprintf(t, sizeof(t), "#%u", i.index);
indexLabel->set_text(t);
- snprintf(t, sizeof(t), "%0.0f%%", (double) pa_sw_volume_to_linear(pa_cvolume_avg(&i.volume)) * 100);
- volumeLabel->set_text(t);
+ if (pa_cvolume_valid(&i.volume)) {
+ snprintf(t, sizeof(t), "%0.0f%%", (double) pa_sw_volume_to_linear(pa_cvolume_avg(&i.volume)) * 100);
+ volumeLabel->set_text(t);
+ } else
+ volumeLabel->set_markup("<i>n/a</i>");
if (i.bytes > 0) {