From c48ed7bb0d22df6ca38f6b2d1beaaf1cbb2acc51 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 23 Mar 2019 20:25:19 -0700 Subject: [PATCH] Fix undefined variable usage after 2703efedef62813e1374f873c76f5156062dc771 --- app/gui/SettingsView.qml | 14 ++++++++------ .../pacer/nullthreadedvsyncsource.cpp | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/gui/SettingsView.qml b/app/gui/SettingsView.qml index 8217c0e4..b974e82c 100644 --- a/app/gui/SettingsView.qml +++ b/app/gui/SettingsView.qml @@ -191,28 +191,30 @@ Flickable { function createModel() { var fpsListModel = Qt.createQmlObject('import QtQuick 2.0; ListModel {}', parent, '') + var max_fps = SystemProperties.maximumStreamingFrameRate + // Default entries fpsListModel.append({"text": "30 FPS", "video_fps": "30"}) fpsListModel.append({"text": "60 FPS", "video_fps": "60"}) // Add unsupported FPS values that come before the display max FPS if (prefs.unsupportedFps) { - if (SystemProperties.maximumStreamingFrameRate > 90) { + if (max_fps > 90) { fpsListModel.append({"text": "90 FPS (Unsupported)", "video_fps": "90"}) } - if (SystemProperties.maximumStreamingFrameRate > 120) { + if (max_fps > 120) { fpsListModel.append({"text": "120 FPS (Unsupported)", "video_fps": "120"}) } } // Use 64 as the cutoff for adding a separate option to // handle wonky displays that report just over 60 Hz. - if (SystemProperties.maximumStreamingFrameRate > 64) { + if (max_fps > 64) { // Mark any FPS value greater than 120 as unsupported if (prefs.unsupportedFps && max_fps > 120) { fpsListModel.append({"text": max_fps+" FPS (Unsupported)", "video_fps": ""+max_fps}) } - else if (SystemProperties.maximumStreamingFrameRate > 120) { + else if (max_fps > 120) { fpsListModel.append({"text": "120 FPS", "video_fps": "120"}) } else { @@ -222,10 +224,10 @@ Flickable { // Add unsupported FPS values that come after the display max FPS if (prefs.unsupportedFps) { - if (SystemProperties.maximumStreamingFrameRate < 90) { + if (max_fps < 90) { fpsListModel.append({"text": "90 FPS (Unsupported)", "video_fps": "90"}) } - if (SystemProperties.maximumStreamingFrameRate < 120) { + if (max_fps < 120) { fpsListModel.append({"text": "120 FPS (Unsupported)", "video_fps": "120"}) } } diff --git a/app/streaming/video/ffmpeg-renderers/pacer/nullthreadedvsyncsource.cpp b/app/streaming/video/ffmpeg-renderers/pacer/nullthreadedvsyncsource.cpp index 806916ab..1ffc67bb 100644 --- a/app/streaming/video/ffmpeg-renderers/pacer/nullthreadedvsyncsource.cpp +++ b/app/streaming/video/ffmpeg-renderers/pacer/nullthreadedvsyncsource.cpp @@ -37,7 +37,7 @@ int NullThreadedVsyncSource::vsyncThread(void* context) SDL_SetThreadPriority(SDL_THREAD_PRIORITY_TIME_CRITICAL); #else SDL_SetThreadPriority(SDL_THREAD_PRIORITY_HIGH); -#endif; +#endif while (SDL_AtomicGet(&me->m_Stopping) == 0) { me->m_Pacer->vsyncCallback(1000 / me->m_DisplayFps);