aboutsummaryrefslogtreecommitdiffstats
path: root/src/mixer
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-03-27 16:44:36 +0100
committerMax Kellermann <max@duempel.org>2009-03-27 16:44:36 +0100
commitd448392f253ed4600f2983eecf492bb9f0ec8716 (patch)
tree6cd9ab3a4cb14125eea521c81a0519c083468970 /src/mixer
parent8258457b434fd24dba6025b474c2d3be8f8183d3 (diff)
downloadmpd-d448392f253ed4600f2983eecf492bb9f0ec8716.tar.gz
mpd-d448392f253ed4600f2983eecf492bb9f0ec8716.tar.xz
mpd-d448392f253ed4600f2983eecf492bb9f0ec8716.zip
pulse_mixer: use local pa_cvolume variable for set_volume()
Don't mess with pulse_mixer.volume for setting the volume. This variable should only be used to transfer the current volume from sink_input_vol() to pulse_mixer_get_volume().
Diffstat (limited to '')
-rw-r--r--src/mixer/pulse_mixer.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mixer/pulse_mixer.c b/src/mixer/pulse_mixer.c
index f9c90191e..0e05271f2 100644
--- a/src/mixer/pulse_mixer.c
+++ b/src/mixer/pulse_mixer.c
@@ -342,12 +342,13 @@ pulse_mixer_set_volume(struct mixer *mixer, unsigned volume)
if (pm->online) {
pa_operation *o;
+ struct pa_cvolume cvolume;
- pa_cvolume_set(&pm->volume, pm->volume.channels,
+ pa_cvolume_set(&cvolume, pm->volume.channels,
(pa_volume_t)volume * PA_VOLUME_NORM / 100 + 0.5);
o = pa_context_set_sink_input_volume(pm->context, pm->index,
- &pm->volume, NULL, NULL);
+ &cvolume, NULL, NULL);
if (o == NULL) {
g_debug("pa_context_set_sink_input_volume() failed");
return false;