mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
sink-input,source-output: Disallow volume change on passthrough streams
We shouldn't be setting volumes on these streams as that would change the content.
This commit is contained in:
parent
6815521f11
commit
3de9f445fa
2 changed files with 10 additions and 0 deletions
|
|
@ -1422,6 +1422,11 @@ void pa_sink_input_set_volume(pa_sink_input *i, const pa_cvolume *volume, bool s
|
|||
pa_assert(volume->channels == 1 || pa_cvolume_compatible(volume, &i->sample_spec));
|
||||
pa_assert(i->volume_writable);
|
||||
|
||||
if (pa_sink_input_is_passthrough(i) && !pa_cvolume_is_norm(volume)) {
|
||||
pa_log_info("Not changing volume for passthrough sink input");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!absolute && pa_sink_flat_volume_enabled(i->sink)) {
|
||||
v = i->sink->reference_volume;
|
||||
pa_cvolume_remap(&v, &i->sink->channel_map, &i->channel_map);
|
||||
|
|
|
|||
|
|
@ -1006,6 +1006,11 @@ void pa_source_output_set_volume(pa_source_output *o, const pa_cvolume *volume,
|
|||
pa_assert(volume->channels == 1 || pa_cvolume_compatible(volume, &o->sample_spec));
|
||||
pa_assert(o->volume_writable);
|
||||
|
||||
if (pa_source_output_is_passthrough(o) && !pa_cvolume_is_norm(volume)) {
|
||||
pa_log_info("Not changing volume for passthrough source output");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!absolute && pa_source_flat_volume_enabled(o->source)) {
|
||||
v = o->source->reference_volume;
|
||||
pa_cvolume_remap(&v, &o->source->channel_map, &o->channel_map);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue