From d448392f253ed4600f2983eecf492bb9f0ec8716 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 27 Mar 2009 16:44:36 +0100 Subject: 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(). --- src/mixer/pulse_mixer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/mixer') 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; -- cgit v1.2.3