aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKurt Van Dijck <kurt.van.dijck@skynet.be>2012-02-24 07:02:47 +0100
committerMax Kellermann <max@duempel.org>2012-03-01 09:51:37 +0100
commitc551c8b31b299b8fa24cf74ea4b35c4c001eaba5 (patch)
tree5c39762111a48580056e7abee9319b1bd2189481
parent9c36e71081841e2203ddb23ff9c9bef6ce65a0fe (diff)
downloadmpd-c551c8b31b299b8fa24cf74ea4b35c4c001eaba5.tar.gz
mpd-c551c8b31b299b8fa24cf74ea4b35c4c001eaba5.tar.xz
mpd-c551c8b31b299b8fa24cf74ea4b35c4c001eaba5.zip
raop_output: fix raop_session inbalance
raop_session_free must be called from raop_output_finish, not from raop_output_remove. In raop_output_remove, do close the ntp_server & control port. Signed-off-by: Kurt Van Dijck <kurt.van.dijck@skynet.be>
Diffstat (limited to '')
-rw-r--r--src/output/raop_output_plugin.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/output/raop_output_plugin.c b/src/output/raop_output_plugin.c
index 68d6897cb..6177b9b7d 100644
--- a/src/output/raop_output_plugin.c
+++ b/src/output/raop_output_plugin.c
@@ -770,6 +770,11 @@ raop_output_finish(struct audio_output *ao)
g_mutex_free(rd->control_mutex);
ao_base_finish(&rd->base);
g_free(rd);
+
+ if (raop_session->raop_list == NULL) {
+ raop_session_free(raop_session);
+ raop_session = NULL;
+ }
}
#define RAOP_VOLUME_MIN -30
@@ -870,8 +875,9 @@ raop_output_remove(struct raop_data *rd)
g_mutex_unlock(raop_session->list_mutex);
if (raop_session->raop_list == NULL) {
- raop_session_free(raop_session);
- raop_session = NULL;
+ ntp_server_close(&raop_session->ntp);
+ close(raop_session->ctrl.fd);
+ raop_session->ctrl.fd = -1;
}
}