summaryrefslogtreecommitdiff
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-25 18:48:44 +0100
commit6623bd2d1baa4e337307abdfe71427b77c8b7061 (patch)
treefc22146af92e0fbae71b9a75c874f7de122b850a
parent19309a3e3acae06d481797e30c8f45030f432d38 (diff)
mixer - try not to create notifications for no change in volume
-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 52e44e0ca..66ebb2652 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