summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/interface.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/interface.c b/src/interface.c
index 771127b..76fb29e 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -187,10 +187,11 @@ void get_input(void)
};
} else
break;
- int input_vol = tmp.tmp_vol + 2 * volume_mult * (VOLUME_MAX / 100);
- tmp.tmp_vol = CLAMP(input_vol, VOLUME_MIN, VOLUME_MAX); /* force input_vol in [0, VOL_NORM] */
- for (int i = 0; i < tmp.volume.channels; ++i)
- tmp.volume.values[i] = tmp.tmp_vol;
+
+ pa_cvolume_set(&tmp.volume, tmp.volume.channels,
+ CLAMP(tmp.tmp_vol + 2 * volume_mult * (VOLUME_MAX / 100),
+ VOLUME_MIN, VOLUME_MAX) /* force vol in [0, VOL_MAX] */
+ );
pa_operation_unref(tmp.volume_set(context, tmp.index, &tmp.volume, change_callback, NULL));
return;