summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-02-23 23:55:16 +0100
committerLennart Poettering <lennart@poettering.net>2009-02-23 23:55:16 +0100
commit998aa40875472c41b74fcecb0eb40c31b690cba7 (patch)
tree135e6458718e732e05b1c01e86432efa2b89eb59
parente0b550710a6d8f5af5209d319de3694243f87b8f (diff)
fix handling of stereo
-rw-r--r--src/pulsecore/protocol-esound.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pulsecore/protocol-esound.c b/src/pulsecore/protocol-esound.c
index 7101aae3..2d4e62fa 100644
--- a/src/pulsecore/protocol-esound.c
+++ b/src/pulsecore/protocol-esound.c
@@ -640,7 +640,7 @@ static int esd_proto_all_info(connection *c, esd_proto_t request, const void *da
pa_cvolume volume = *pa_sink_input_get_volume(conn->sink_input);
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[1]*ESD_VOLUME_BASE)/PA_VOLUME_NORM);
+ rvolume = (int32_t) ((volume.values[volume.channels == 2 ? 1 : 0]*ESD_VOLUME_BASE)/PA_VOLUME_NORM);
format = format_native2esd(&conn->sink_input->sample_spec);
}
@@ -775,7 +775,8 @@ static int esd_proto_stream_pan(connection *c, esd_proto_t request, const void *
pa_cvolume volume;
volume.values[0] = (lvolume*PA_VOLUME_NORM)/ESD_VOLUME_BASE;
volume.values[1] = (rvolume*PA_VOLUME_NORM)/ESD_VOLUME_BASE;
- volume.channels = 2;
+ volume.channels = conn->sink_input->sample_spec.channels;
+
pa_sink_input_set_volume(conn->sink_input, &volume, TRUE);
ok = 1;
} else