ignore sinks that do not carry decibel information
authorLennart Poettering <lennart@poettering.net>
Tue, 7 Oct 2008 22:12:15 +0000 (00:12 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 7 Oct 2008 22:12:15 +0000 (00:12 +0200)
src/modules/module-flat-volume.c

index 5e33928..3bb0c87 100644 (file)
@@ -69,6 +69,9 @@ static void process_input_volume_change(pa_cvolume *dest_volume, const pa_cvolum
     pa_assert(dest_channel_map);
     pa_assert(sink);
 
+    if (!(sink->flags & PA_SINK_DECIBEL_VOLUME))
+        return;
+
     pa_log_debug("Sink input volume changed");
 
     max_volume = *dest_virtual_volume;
@@ -167,6 +170,9 @@ static void subscribe_callback(pa_core *core, pa_subscription_event_type_t t, ui
     if (!(sink = pa_idxset_get_by_index(core->sinks, idx)))
         return;
 
+    if (!(sink->flags & PA_SINK_DECIBEL_VOLUME))
+        return;
+
     pa_log_debug("Sink volume changed");
     pa_log_debug("sink = %.2f", (double)pa_cvolume_avg(pa_sink_get_volume(sink, FALSE)) / PA_VOLUME_NORM);