mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-31 22:25:33 -04:00
if the channel map was modified due to PA_SINK_INPUT_FIX_CHANNELS, remap the specified volume properly
This commit is contained in:
parent
e1dbc75eb8
commit
e053fa03f7
1 changed files with 3 additions and 2 deletions
|
|
@ -171,6 +171,8 @@ pa_sink_input* pa_sink_input_new(
|
|||
if (flags & PA_SINK_INPUT_FIX_RATE)
|
||||
data->sample_spec.rate = data->sink->sample_spec.rate;
|
||||
|
||||
original_cm = data->channel_map;
|
||||
|
||||
if (flags & PA_SINK_INPUT_FIX_CHANNELS) {
|
||||
data->sample_spec.channels = data->sink->sample_spec.channels;
|
||||
data->channel_map = data->sink->channel_map;
|
||||
|
|
@ -180,8 +182,7 @@ pa_sink_input* pa_sink_input_new(
|
|||
pa_assert(pa_channel_map_valid(&data->channel_map));
|
||||
|
||||
/* Due to the fixing of the sample spec the volume might not match anymore */
|
||||
if (data->volume.channels != data->sample_spec.channels)
|
||||
pa_cvolume_set(&data->volume, data->sample_spec.channels, pa_cvolume_avg(&data->volume));
|
||||
pa_cvolume_remap(&data->volume, &original_cm, &data->channel_map);
|
||||
|
||||
if (data->resample_method == PA_RESAMPLER_INVALID)
|
||||
data->resample_method = core->resample_method;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue