From 0697e37b269ce4d2e83059b7ddf0d0571915a803 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Mon, 15 May 2017 14:13:12 -0700 Subject: [PATCH] UI: Fix misleading log message when updating settings While an output is active, the user may try to reset the settings in the settings window, causing a misleading error message to be thrown in the log indicating that it's "falling back" to OpenGL. Instead, if an output is currently active, do not reset video. --- UI/window-basic-main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index c21da7459..9034048fc 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -2692,6 +2692,9 @@ static inline enum video_format GetVideoFormatFromName(const char *name) int OBSBasic::ResetVideo() { + if (outputHandler && outputHandler->Active()) + return OBS_VIDEO_CURRENTLY_ACTIVE; + ProfileScope("OBSBasic::ResetVideo"); struct obs_video_info ovi; @@ -2742,6 +2745,12 @@ int OBSBasic::ResetVideo() ret = AttemptToResetVideo(&ovi); if (IS_WIN32 && ret != OBS_VIDEO_SUCCESS) { + if (ret == OBS_VIDEO_CURRENTLY_ACTIVE) { + blog(LOG_WARNING, "Tried to reset when " + "already active"); + return ret; + } + /* Try OpenGL if DirectX fails on windows */ if (astrcmpi(ovi.graphics_module, DL_OPENGL) != 0) { blog(LOG_WARNING, "Failed to initialize obs video (%d) "