mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
core: introduce new 'reference' volume for sinks
The reference volume is to be used as reference volume for stored stream volumes. Previously if a new stream was created the relative volume was taken relatively to the virtual device volume. Due to the flat volume logic this could then be fed back to the virtual device volume. Repeating the whole story over and over would result in a device volume that would go lower, and lower and lower. This patch introduces a 'reference' volume for each sink which stays unmodified by stream volume changes even if flat volumes are used. It is only modified if the sink volumes are modified directly by the user. For further explanations see http://pulseaudio.org/wiki/InternalVolumes
This commit is contained in:
parent
49dcf0940e
commit
fe8b10cc05
15 changed files with 152 additions and 159 deletions
|
|
@ -638,7 +638,8 @@ static int esd_proto_all_info(connection *c, esd_proto_t request, const void *da
|
|||
pa_assert(t >= k*2+s);
|
||||
|
||||
if (conn->sink_input) {
|
||||
pa_cvolume volume = *pa_sink_input_get_volume(conn->sink_input);
|
||||
pa_cvolume volume;
|
||||
pa_sink_input_get_volume(conn->sink_input, &volume, TRUE);
|
||||
rate = (int32_t) conn->sink_input->sample_spec.rate;
|
||||
lvolume = (int32_t) ((volume.values[0]*ESD_VOLUME_BASE)/PA_VOLUME_NORM);
|
||||
rvolume = (int32_t) ((volume.values[volume.channels == 2 ? 1 : 0]*ESD_VOLUME_BASE)/PA_VOLUME_NORM);
|
||||
|
|
@ -778,7 +779,7 @@ static int esd_proto_stream_pan(connection *c, esd_proto_t request, const void *
|
|||
volume.values[1] = (rvolume*PA_VOLUME_NORM)/ESD_VOLUME_BASE;
|
||||
volume.channels = conn->sink_input->sample_spec.channels;
|
||||
|
||||
pa_sink_input_set_volume(conn->sink_input, &volume, TRUE);
|
||||
pa_sink_input_set_volume(conn->sink_input, &volume, TRUE, TRUE);
|
||||
ok = 1;
|
||||
} else
|
||||
ok = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue