diff options
author | Max Kellermann <max@duempel.org> | 2013-01-27 22:53:21 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-01-27 22:53:21 +0100 |
commit | 2cbe21c791aeb28c61a26a6ff447ba2089f58181 (patch) | |
tree | 403beae3db829f83fc0a7a019058c78f14ed50e0 | |
parent | 0988056471fefa2ee195a170dcf57771e7926a08 (diff) | |
download | mpd-2cbe21c791aeb28c61a26a6ff447ba2089f58181.tar.gz mpd-2cbe21c791aeb28c61a26a6ff447ba2089f58181.tar.xz mpd-2cbe21c791aeb28c61a26a6ff447ba2089f58181.zip |
ZeroconfAvahi: pass GMainContext to avahi_glib_poll_new()
-rw-r--r-- | src/ZeroconfAvahi.cxx | 6 | ||||
-rw-r--r-- | src/ZeroconfAvahi.hxx | 6 | ||||
-rw-r--r-- | src/ZeroconfGlue.cxx | 2 |
3 files changed, 9 insertions, 5 deletions
diff --git a/src/ZeroconfAvahi.cxx b/src/ZeroconfAvahi.cxx index 8fa745a69..4764ad755 100644 --- a/src/ZeroconfAvahi.cxx +++ b/src/ZeroconfAvahi.cxx @@ -21,6 +21,7 @@ #include "ZeroconfAvahi.hxx" #include "ZeroconfInternal.hxx" #include "Listen.hxx" +#include "event/Loop.hxx" #include "mpd_error.h" #include <glib.h> @@ -216,7 +217,7 @@ static void avahiClientCallback(AvahiClient * c, AvahiClientState state, } void -AvahiInit(const char *serviceName) +AvahiInit(EventLoop &loop, const char *serviceName) { int error; g_debug("Initializing interface"); @@ -228,7 +229,8 @@ AvahiInit(const char *serviceName) avahiRunning = 1; - avahi_glib_poll = avahi_glib_poll_new(NULL, G_PRIORITY_DEFAULT); + avahi_glib_poll = avahi_glib_poll_new(loop.GetContext(), + G_PRIORITY_DEFAULT); avahi_poll = avahi_glib_poll_get(avahi_glib_poll); avahiClient = avahi_client_new(avahi_poll, AVAHI_CLIENT_NO_FAIL, diff --git a/src/ZeroconfAvahi.hxx b/src/ZeroconfAvahi.hxx index 2db2523c3..bb046350a 100644 --- a/src/ZeroconfAvahi.hxx +++ b/src/ZeroconfAvahi.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2011 The Music Player Daemon Project + * Copyright (C) 2003-2013 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -20,8 +20,10 @@ #ifndef MPD_ZEROCONF_AVAHI_HXX #define MPD_ZEROCONF_AVAHI_HXX +class EventLoop; + void -AvahiInit(const char *service_name); +AvahiInit(EventLoop &loop, const char *service_name); void AvahiDeinit(); diff --git a/src/ZeroconfGlue.cxx b/src/ZeroconfGlue.cxx index fd53faa42..14e1d0866 100644 --- a/src/ZeroconfGlue.cxx +++ b/src/ZeroconfGlue.cxx @@ -55,7 +55,7 @@ ZeroconfInit(gcc_unused EventLoop &loop) serviceName = config_get_string(CONF_ZEROCONF_NAME, SERVICE_NAME); #ifdef HAVE_AVAHI - AvahiInit(serviceName); + AvahiInit(loop, serviceName); #endif #ifdef HAVE_BONJOUR |