summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/protocol-esound.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-01-15 17:52:29 +0100
committerLennart Poettering <lennart@poettering.net>2009-01-15 17:52:29 +0100
commit5abda63a1fa4d2c867af8b33b0090cd651ba8599 (patch)
tree608d616ae082b7d0accec9caa317c4aa56a27696 /src/pulsecore/protocol-esound.c
parent75119e91cdb4f29b0567689d07d00ddc17a98b5c (diff)
convert pa_client instantiation to use a pa_client_new_data struct and add hooks for manipulating it
Diffstat (limited to 'src/pulsecore/protocol-esound.c')
-rw-r--r--src/pulsecore/protocol-esound.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/pulsecore/protocol-esound.c b/src/pulsecore/protocol-esound.c
index 2f014827..6524b684 100644
--- a/src/pulsecore/protocol-esound.c
+++ b/src/pulsecore/protocol-esound.c
@@ -1377,7 +1377,9 @@ static void auth_timeout(pa_mainloop_api*m, pa_time_event *e, const struct timev
void pa_esound_protocol_connect(pa_esound_protocol *p, pa_iochannel *io, pa_esound_options *o) {
connection *c;
- char cname[256], pname[128];
+ char pname[128];
+ pa_client_new_data data;
+ pa_client *client;
pa_assert(p);
pa_assert(io);
@@ -1389,6 +1391,18 @@ void pa_esound_protocol_connect(pa_esound_protocol *p, pa_iochannel *io, pa_esou
return;
}
+ pa_client_new_data_init(&data);
+ data.module = o->module;
+ data.driver = __FILE__;
+ pa_iochannel_socket_peer_to_string(io, pname, sizeof(pname));
+ pa_proplist_setf(data.proplist, PA_PROP_APPLICATION_NAME, "EsounD client (%s)", pname);
+ pa_proplist_sets(data.proplist, "esound-protocol.peer", pname);
+ client = pa_client_new(p->core, &data);
+ pa_client_new_data_done(&data);
+
+ if (!client)
+ return;
+
c = pa_msgobject_new(connection);
c->parent.parent.free = connection_free;
c->parent.process_msg = connection_process_msg;
@@ -1396,11 +1410,7 @@ void pa_esound_protocol_connect(pa_esound_protocol *p, pa_iochannel *io, pa_esou
c->io = io;
pa_iochannel_set_callback(c->io, io_callback, c);
- pa_iochannel_socket_peer_to_string(io, pname, sizeof(pname));
- pa_snprintf(cname, sizeof(cname), "EsounD client (%s)", pname);
- c->client = pa_client_new(p->core, __FILE__, cname);
- pa_proplist_sets(c->client->proplist, "esound-protocol.peer", pname);
- c->client->module = o->module;
+ c->client = client;
c->client->kill = client_kill_cb;
c->client->userdata = c;