summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-09-20 13:48:31 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-09-20 13:48:31 +0100
commit2747af8e07ad1b65a6f9ba7aff359ef94d6d8cc2 (patch)
treef9708d22f1b1c399193f85241272bc67cad3b6c2 /src/modules
parentc16a58d75f69529cfba4ce6d13596c31bcc6c02e (diff)
mixer - try not to create notifications for no change in volume
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/mixer/gadget/backend.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/modules/mixer/gadget/backend.c b/src/modules/mixer/gadget/backend.c
index 52e44e0..66ebb26 100644
--- a/src/modules/mixer/gadget/backend.c
+++ b/src/modules/mixer/gadget/backend.c
@@ -351,10 +351,8 @@ _sink_event(int type, void *info)
351 if (sink == _sink_default) 351 if (sink == _sink_default)
352 { 352 {
353 l = emix_sinks_get(); 353 l = emix_sinks_get();
354 if (l) 354 if (l) _sink_default = l->data;
355 _sink_default = l->data; 355 else _sink_default = NULL;
356 else
357 _sink_default = NULL;
358 if (emix_config_save_get()) e_config_save_queue(); 356 if (emix_config_save_get()) e_config_save_queue();
359 _backend_changed(); 357 _backend_changed();
360 } 358 }
@@ -363,15 +361,17 @@ _sink_event(int type, void *info)
363 { 361 {
364 if (_sink_default == sink) 362 if (_sink_default == sink)
365 { 363 {
364 static int prev_vol = -1;
366 int vol; 365 int vol;
367 366
368 _backend_changed(); 367 _backend_changed();
369 if (sink->mute || !sink->volume.channel_count) 368 if (sink->mute || !sink->volume.channel_count) vol = 0;
370 vol = 0; 369 else vol = sink->volume.volumes[0];
371 else 370 if (vol != prev_vol)
372 vol = sink->volume.volumes[0]; 371 {
373 372 _notify(vol);
374 _notify(vol); 373 prev_vol = vol;
374 }
375 } 375 }
376 } 376 }
377 else 377 else