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:
parent
8258457b43
commit
d448392f25
@ -342,12 +342,13 @@ pulse_mixer_set_volume(struct mixer *mixer, unsigned volume)
|
|||||||
|
|
||||||
if (pm->online) {
|
if (pm->online) {
|
||||||
pa_operation *o;
|
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);
|
(pa_volume_t)volume * PA_VOLUME_NORM / 100 + 0.5);
|
||||||
|
|
||||||
o = pa_context_set_sink_input_volume(pm->context, pm->index,
|
o = pa_context_set_sink_input_volume(pm->context, pm->index,
|
||||||
&pm->volume, NULL, NULL);
|
&cvolume, NULL, NULL);
|
||||||
if (o == NULL) {
|
if (o == NULL) {
|
||||||
g_debug("pa_context_set_sink_input_volume() failed");
|
g_debug("pa_context_set_sink_input_volume() failed");
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user