summaryrefslogtreecommitdiffstats
path: root/src/polypcore/protocol-esound.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2006-05-14 00:41:18 +0000
committerLennart Poettering <lennart@poettering.net>2006-05-14 00:41:18 +0000
commitbe05b18c6fb6f0e2e2b74ffdf251692a45eaa045 (patch)
tree7974db8d050c3fd6e19dcd3aaa7dde5875f91168 /src/polypcore/protocol-esound.c
parente46f8f8eb3fd586f8728e43292509434e0e8b089 (diff)
* add new parameter to pa_open_config_file() to specify open mode
* modify pa_sink_input_new() to take initial volume settings as argument * call pa_sink_input_set_volume() when changing stream volume in protocol-esound.c to make sure that subscribe events are issued properly git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@858 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/polypcore/protocol-esound.c')
-rw-r--r--src/polypcore/protocol-esound.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/polypcore/protocol-esound.c b/src/polypcore/protocol-esound.c
index 56a11365..50c8b6b5 100644
--- a/src/polypcore/protocol-esound.c
+++ b/src/polypcore/protocol-esound.c
@@ -345,7 +345,7 @@ static int esd_proto_stream_play(struct connection *c, PA_GCC_UNUSED esd_proto_t
assert(!c->sink_input && !c->input_memblockq);
- c->sink_input = pa_sink_input_new(sink, __FILE__, name, &ss, NULL, 0, -1);
+ c->sink_input = pa_sink_input_new(sink, __FILE__, name, &ss, NULL, NULL, 0, -1);
CHECK_VALIDITY(c->sink_input, "Failed to create sink input.");
@@ -532,9 +532,10 @@ static int esd_proto_all_info(struct connection *c, esd_proto_t request, const v
assert(t >= k*2+s);
if (conn->sink_input) {
+ pa_cvolume volume = *pa_sink_input_get_volume(conn->sink_input);
rate = conn->sink_input->sample_spec.rate;
- lvolume = (conn->sink_input->volume.values[0]*ESD_VOLUME_BASE)/PA_VOLUME_NORM;
- rvolume = (conn->sink_input->volume.values[1]*ESD_VOLUME_BASE)/PA_VOLUME_NORM;
+ lvolume = (volume.values[0]*ESD_VOLUME_BASE)/PA_VOLUME_NORM;
+ rvolume = (volume.values[1]*ESD_VOLUME_BASE)/PA_VOLUME_NORM;
format = format_native2esd(&conn->sink_input->sample_spec);
}
@@ -643,11 +644,12 @@ static int esd_proto_stream_pan(struct connection *c, PA_GCC_UNUSED esd_proto_t
rvolume = MAYBE_UINT32_SWAP(c->swap_byte_order, rvolume);
data = (const char*)data + sizeof(uint32_t);
- if ((conn = pa_idxset_get_by_index(c->protocol->connections, idx))) {
- assert(conn->sink_input);
- conn->sink_input->volume.values[0] = (lvolume*PA_VOLUME_NORM)/ESD_VOLUME_BASE;
- conn->sink_input->volume.values[1] = (rvolume*PA_VOLUME_NORM)/ESD_VOLUME_BASE;
- conn->sink_input->volume.channels = 2;
+ if ((conn = pa_idxset_get_by_index(c->protocol->connections, idx)) && conn->sink_input) {
+ 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;
+ pa_sink_input_set_volume(conn->sink_input, &volume);
ok = 1;
} else
ok = 0;