From: Colin Guthrie Date: Sun, 11 May 2008 14:19:41 +0000 (+0000) Subject: Listen to the on_close callback. This still causes asserts in the mainloop, so this... X-Git-Tag: v0.9.15-test1~329^2~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ec9a618768790055fef00a46866b4e0e1fa33048;p=platform%2Fupstream%2Fpulseaudio.git Listen to the on_close callback. This still causes asserts in the mainloop, so this is not a complete solution git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2403 fefdeb5f-60dc-0310-8127-8f9354f1896f --- diff --git a/src/modules/module-raop-sink.c b/src/modules/module-raop-sink.c index f6f93a4..090f04f 100644 --- a/src/modules/module-raop-sink.c +++ b/src/modules/module-raop-sink.c @@ -340,6 +340,14 @@ static void on_connection(PA_GCC_UNUSED int fd, void*userdata) { pa_asyncmsgq_post(u->thread_mq.inq, PA_MSGOBJECT(u->sink), SINK_MESSAGE_PASS_SOCKET, NULL, 0, NULL, NULL); } +static void on_close(void*userdata) { + struct userdata *u = userdata; + pa_assert(u); + + pa_log_debug("Control connection closed."); + pa_module_unload_request(u->module); +} + int pa__init(pa_module*m) { struct userdata *u = NULL; const char *p; @@ -420,6 +428,7 @@ int pa__init(pa_module*m) { } pa_raop_client_set_callback(u->raop, on_connection, u); + pa_raop_client_set_closed_callback(u->raop, on_close, u); pa_sink_set_description(u->sink, t = pa_sprintf_malloc("Airtunes sink '%s'", p)); pa_xfree(t);