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().
This commit is contained in:
Max Kellermann 2009-03-27 16:44:36 +01:00
parent 8258457b43
commit d448392f25

View File

@ -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;