From 5477f58f18707eeb8fb4dc943826b399133c6bf9 Mon Sep 17 00:00:00 2001 From: Tony Langhammer Date: Tue, 10 Jan 2023 19:25:16 +0100 Subject: [PATCH] Move the check for UPnP enabled up to avoid error messages (#748) --- src/upnp.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/upnp.cpp b/src/upnp.cpp index 36c06921..0dbdb361 100644 --- a/src/upnp.cpp +++ b/src/upnp.cpp @@ -91,6 +91,10 @@ static std::string_view status_string(int status) { } std::unique_ptr 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 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));