From fbe5eb98f9a4c24c1779af1b15f47b8568b088d7 Mon Sep 17 00:00:00 2001 From: Tony Langhammer Date: Tue, 10 Jan 2023 17:44:19 +0100 Subject: [PATCH] Move the check for UPnP enabled up to avoid error messages --- src/upnp.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/upnp.cpp b/src/upnp.cpp index 36c0692126c..0dbdb36190d 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));