Commit bf582bd9 authored by Max Kellermann's avatar Max Kellermann

ZeroconfGlue: use struct ConfigData

parent ad866f7a
......@@ -593,7 +593,7 @@ try {
instance->neighbors->Open();
#endif
ZeroconfInit(instance->event_loop);
ZeroconfInit(GetGlobalConfig(), instance->event_loop);
for (auto &partition : instance->partitions)
StartPlayerThread(partition.pc);
......
......@@ -21,7 +21,7 @@
#include "ZeroconfGlue.hxx"
#include "ZeroconfAvahi.hxx"
#include "ZeroconfBonjour.hxx"
#include "config/Global.hxx"
#include "config/Data.hxx"
#include "config/Option.hxx"
#include "Listen.hxx"
#include "util/Domain.hxx"
......@@ -40,12 +40,12 @@ static constexpr Domain zeroconf_domain("zeroconf");
static int zeroconfEnabled;
void
ZeroconfInit(gcc_unused EventLoop &loop)
ZeroconfInit(const ConfigData &config, gcc_unused EventLoop &loop)
{
const char *serviceName;
zeroconfEnabled = config_get_bool(ConfigOption::ZEROCONF_ENABLED,
DEFAULT_ZEROCONF_ENABLED);
zeroconfEnabled = config.GetBool(ConfigOption::ZEROCONF_ENABLED,
DEFAULT_ZEROCONF_ENABLED);
if (!zeroconfEnabled)
return;
......@@ -56,8 +56,8 @@ ZeroconfInit(gcc_unused EventLoop &loop)
return;
}
serviceName = config_get_string(ConfigOption::ZEROCONF_NAME,
SERVICE_NAME);
serviceName = config.GetString(ConfigOption::ZEROCONF_NAME,
SERVICE_NAME);
#ifdef HAVE_AVAHI
AvahiInit(loop, serviceName);
......
......@@ -22,12 +22,13 @@
#include "check.h"
struct ConfigData;
class EventLoop;
#ifdef HAVE_ZEROCONF
void
ZeroconfInit(EventLoop &loop);
ZeroconfInit(const ConfigData &config, EventLoop &loop);
void
ZeroconfDeinit();
......@@ -35,7 +36,7 @@ ZeroconfDeinit();
#else /* ! HAVE_ZEROCONF */
static inline void
ZeroconfInit(EventLoop &)
ZeroconfInit(const ConfigData &, EventLoop &)
{}
static inline void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment