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.
This commit is contained in:
parent
92a258690e
commit
0697e37b26
@ -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) "
|
||||
|
Loading…
x
Reference in New Issue
Block a user