From 241bf4913da1ab4c1797ea7bbac9aefa1725f432 Mon Sep 17 00:00:00 2001 From: badaix Date: Tue, 2 Apr 2024 22:24:51 +0200 Subject: [PATCH] Fix setting HTTP host name --- server/snapserver.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/server/snapserver.cpp b/server/snapserver.cpp index e6ad30dd..875584e0 100644 --- a/server/snapserver.cpp +++ b/server/snapserver.cpp @@ -1,6 +1,6 @@ /*** This file is part of snapcast - Copyright (C) 2014-2023 Johannes Pohl + Copyright (C) 2014-2024 Johannes Pohl This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,10 +21,7 @@ #ifdef HAS_DAEMON #include "common/daemon.hpp" #endif -#include "common/message/message.hpp" -#include "common/sample_format.hpp" #include "common/snap_exception.hpp" -#include "common/time_defs.hpp" #include "common/utils/string_utils.hpp" #include "common/version.hpp" #include "encoder/encoder_factory.hpp" @@ -291,14 +288,18 @@ int main(int argc, char* argv[]) if (settings.http.enabled) { dns_services.emplace_back("_snapcast-http._tcp", settings.http.port); + } + publishZeroConfg->publish(dns_services); +#endif + if (settings.http.enabled) + { if ((settings.http.host == "") || settings.http.host.empty()) { settings.http.host = boost::asio::ip::host_name(); LOG(INFO, LOG_TAG) << "Using HTTP host name: " << settings.http.host << "\n"; } } - publishZeroConfg->publish(dns_services); -#endif + if (settings.stream.streamChunkMs < 10) { LOG(WARNING, LOG_TAG) << "Stream read chunk size is less than 10ms, changing to 10ms\n";