Set the main thread to high priority since it's used for rendering

This commit is contained in:
Cameron Gutman 2018-07-16 21:25:59 -07:00
parent 20495c3752
commit d3f7204cff

View file

@ -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;