mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-04 20:56:38 +02:00
Fix setting HTTP host name
This commit is contained in:
parent
e57dc0888f
commit
241bf4913d
1 changed files with 7 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
||||||
/***
|
/***
|
||||||
This file is part of snapcast
|
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
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -21,10 +21,7 @@
|
||||||
#ifdef HAS_DAEMON
|
#ifdef HAS_DAEMON
|
||||||
#include "common/daemon.hpp"
|
#include "common/daemon.hpp"
|
||||||
#endif
|
#endif
|
||||||
#include "common/message/message.hpp"
|
|
||||||
#include "common/sample_format.hpp"
|
|
||||||
#include "common/snap_exception.hpp"
|
#include "common/snap_exception.hpp"
|
||||||
#include "common/time_defs.hpp"
|
|
||||||
#include "common/utils/string_utils.hpp"
|
#include "common/utils/string_utils.hpp"
|
||||||
#include "common/version.hpp"
|
#include "common/version.hpp"
|
||||||
#include "encoder/encoder_factory.hpp"
|
#include "encoder/encoder_factory.hpp"
|
||||||
|
@ -291,14 +288,18 @@ int main(int argc, char* argv[])
|
||||||
if (settings.http.enabled)
|
if (settings.http.enabled)
|
||||||
{
|
{
|
||||||
dns_services.emplace_back("_snapcast-http._tcp", settings.http.port);
|
dns_services.emplace_back("_snapcast-http._tcp", settings.http.port);
|
||||||
|
}
|
||||||
|
publishZeroConfg->publish(dns_services);
|
||||||
|
#endif
|
||||||
|
if (settings.http.enabled)
|
||||||
|
{
|
||||||
if ((settings.http.host == "<hostname>") || settings.http.host.empty())
|
if ((settings.http.host == "<hostname>") || settings.http.host.empty())
|
||||||
{
|
{
|
||||||
settings.http.host = boost::asio::ip::host_name();
|
settings.http.host = boost::asio::ip::host_name();
|
||||||
LOG(INFO, LOG_TAG) << "Using HTTP host name: " << settings.http.host << "\n";
|
LOG(INFO, LOG_TAG) << "Using HTTP host name: " << settings.http.host << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
publishZeroConfg->publish(dns_services);
|
|
||||||
#endif
|
|
||||||
if (settings.stream.streamChunkMs < 10)
|
if (settings.stream.streamChunkMs < 10)
|
||||||
{
|
{
|
||||||
LOG(WARNING, LOG_TAG) << "Stream read chunk size is less than 10ms, changing to 10ms\n";
|
LOG(WARNING, LOG_TAG) << "Stream read chunk size is less than 10ms, changing to 10ms\n";
|
||||||
|
|
Loading…
Add table
Reference in a new issue