summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-05-14 17:13:28 +0000
committerLennart Poettering <lennart@poettering.net>2008-05-14 17:13:28 +0000
commitdf73688440230ac62e7e4e190a99194274473029 (patch)
tree547e703d67fc8a62784dd5025d2e7f3a2e349ca4
parent37813d97452095b87cb160a21f52b9bdea5c50fb (diff)
modernizations
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2422 fefdeb5f-60dc-0310-8127-8f9354f1896f
-rw-r--r--src/modules/module-esound-sink.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/modules/module-esound-sink.c b/src/modules/module-esound-sink.c
index 4aa7d674..87b87c3d 100644
--- a/src/modules/module-esound-sink.c
+++ b/src/modules/module-esound-sink.c
@@ -294,7 +294,7 @@ static void thread_func(void *userdata) {
}
/* Hmm, nothing to do. Let's sleep */
- pollfd->events = PA_SINK_IS_OPENED(u->sink->thread_info.state) ? POLLOUT : 0;
+ pollfd->events = PA_SINK_IS_OPENED(u->sink->thread_info.state) ? POLLOUT : 0;
}
if ((ret = pa_rtpoll_run(u->rtpoll, TRUE)) < 0)
@@ -502,10 +502,8 @@ static void on_connection(PA_GCC_UNUSED pa_socket_client *c, pa_iochannel*io, vo
int pa__init(pa_module*m) {
struct userdata *u = NULL;
- const char *p;
pa_sample_spec ss;
pa_modargs *ma = NULL;
- char *t;
const char *espeaker;
uint32_t key;
pa_sink_new_data data;
@@ -554,11 +552,18 @@ int pa__init(pa_module*m) {
u->state = STATE_AUTH;
u->latency = 0;
+ if (!(espeaker = getenv("ESPEAKER")))
+ espeaker = ESD_UNIX_SOCKET_NAME;
+
+ espeaker = pa_modargs_get_value(ma, "server", espeaker);
+
pa_sink_new_data_init(&data);
data.driver = __FILE__;
data.module = m;
pa_sink_new_data_set_name(&data, pa_modargs_get_value(ma, "sink_name", DEFAULT_SINK_NAME));
pa_sink_new_data_set_sample_spec(&data, &ss);
+ pa_proplist_sets(data.proplist, PA_PROP_DEVICE_STRING, espeaker);
+ pa_proplist_setf(data.proplist, PA_PROP_DEVICE_DESCRIPTION, "Esound sink '%s'", espeaker);
u->sink = pa_sink_new(m->core, &data, PA_SINK_LATENCY|PA_SINK_NETWORK);
pa_sink_new_data_done(&data);
@@ -574,17 +579,11 @@ int pa__init(pa_module*m) {
pa_sink_set_asyncmsgq(u->sink, u->thread_mq.inq);
pa_sink_set_rtpoll(u->sink, u->rtpoll);
- if (!(espeaker = getenv("ESPEAKER")))
- espeaker = ESD_UNIX_SOCKET_NAME;
-
- if (!(u->client = pa_socket_client_new_string(u->core->mainloop, p = pa_modargs_get_value(ma, "server", espeaker), ESD_DEFAULT_PORT))) {
+ if (!(u->client = pa_socket_client_new_string(u->core->mainloop, espeaker, ESD_DEFAULT_PORT))) {
pa_log("Failed to connect to server.");
goto fail;
}
- pa_sink_set_description(u->sink, t = pa_sprintf_malloc("Esound sink '%s'", p));
- pa_xfree(t);
-
pa_socket_client_set_callback(u->client, on_connection, u);
/* Prepare the initial request */