mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-12-13 21:02:28 +00:00
Allow renderers that force V-sync on to run without it when streaming higher than the display refresh rate
This commit is contained in:
parent
c9a7c15f98
commit
93c683be3a
1 changed files with 8 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
||||||
#include <Limelight.h>
|
#include <Limelight.h>
|
||||||
#include "ffmpeg.h"
|
#include "ffmpeg.h"
|
||||||
|
#include "streaming/streamutils.h"
|
||||||
|
|
||||||
#ifdef Q_OS_WIN32
|
#ifdef Q_OS_WIN32
|
||||||
#include "ffmpeg-renderers/dxva2.h"
|
#include "ffmpeg-renderers/dxva2.h"
|
||||||
|
@ -127,9 +128,13 @@ bool FFmpegVideoDecoder::completeInitialization(AVCodec* decoder, SDL_Window* wi
|
||||||
enableVsync = false;
|
enableVsync = false;
|
||||||
}
|
}
|
||||||
else if (vsyncConstraint == IFFmpegRenderer::VSYNC_FORCE_ON && !enableVsync) {
|
else if (vsyncConstraint == IFFmpegRenderer::VSYNC_FORCE_ON && !enableVsync) {
|
||||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
// FIXME: This duplicates logic in Session.cpp
|
||||||
"V-sync is forcefully enabled by the active renderer");
|
int displayHz = StreamUtils::getDisplayRefreshRate(window);
|
||||||
enableVsync = true;
|
if (displayHz + 5 >= maxFps) {
|
||||||
|
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
"V-sync is forcefully enabled by the active renderer");
|
||||||
|
enableVsync = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Pacer = new Pacer(m_Renderer);
|
m_Pacer = new Pacer(m_Renderer);
|
||||||
|
|
Loading…
Reference in a new issue