summaryrefslogtreecommitdiffstats
path: root/src/pulsecore
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-10-07 22:46:18 +0200
committerLennart Poettering <lennart@poettering.net>2008-10-23 22:53:31 +0200
commitf0a2294f685985fd6edcf3a52018cc833eb5fa11 (patch)
tree1c74c156330c093433b93b845fb391eabc7b2478 /src/pulsecore
parent215f1fbffa18caa1cfb8ac4c7c3a108dc740a2c6 (diff)
if the channel map was modified due to PA_SINK_INPUT_FIX_CHANNELS, remap the specified volume properly
Diffstat (limited to 'src/pulsecore')
-rw-r--r--src/pulsecore/sink-input.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index 89aaf555..cade0dba 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -167,6 +167,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;
@@ -176,8 +178,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;