mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-09-20 06:01:57 +00:00
Set the main thread to high priority since it's used for rendering
This commit is contained in:
parent
20495c3752
commit
d3f7204cff
1 changed files with 8 additions and 0 deletions
|
@ -386,6 +386,14 @@ void Session::exec()
|
|||
// Disable the screen saver
|
||||
SDL_DisableScreenSaver();
|
||||
|
||||
// Raise the priority of the main thread, since it handles
|
||||
// time-sensitive video rendering
|
||||
if (SDL_SetThreadPriority(SDL_THREAD_PRIORITY_HIGH) < 0) {
|
||||
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"Unable to set main thread to high priority: %s",
|
||||
SDL_GetError());
|
||||
}
|
||||
|
||||
// Hijack this thread to be the SDL main thread. We have to do this
|
||||
// because we want to suspend all Qt processing until the stream is over.
|
||||
SDL_Event event;
|
||||
|
|
Loading…
Reference in a new issue