Move the check for UPnP enabled up to avoid error messages (#748)

This commit is contained in:
Tony Langhammer
2023-01-10 19:25:16 +01:00
committed by GitHub
parent 7dbd5b41b2
commit 5477f58f18

View File

@@ -91,6 +91,10 @@ static std::string_view status_string(int status) {
}
std::unique_ptr<platf::deinit_t> start() {
if(!config::sunshine.flags[config::flag::UPNP]) {
return nullptr;
}
int err {};
device_t device { upnpDiscover(2000, nullptr, nullptr, 0, IPv4, 2, &err) };
@@ -128,10 +132,6 @@ std::unique_ptr<platf::deinit_t> start() {
}
}
if(!config::sunshine.flags[config::flag::UPNP]) {
return nullptr;
}
auto rtsp = std::to_string(map_port(stream::RTSP_SETUP_PORT));
auto video = std::to_string(map_port(stream::VIDEO_STREAM_PORT));
auto audio = std::to_string(map_port(stream::AUDIO_STREAM_PORT));