mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-12-13 21:02:28 +00:00
Fix random deadlocks on window resize with the software decoder due to processing window messages off the render thread
This commit is contained in:
parent
948910bfa2
commit
54383b84ec
1 changed files with 8 additions and 0 deletions
|
@ -143,6 +143,14 @@ bool SdlRenderer::initialize(SDL_Window* window,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN32
|
||||||
|
// We render on a different thread than the main thread which is handling window
|
||||||
|
// messages. Without D3DCREATE_MULTITHREADED, this can cause a deadlock by blocking
|
||||||
|
// on a window message being processed while the main thread is blocked waiting for
|
||||||
|
// the render thread to finish.
|
||||||
|
SDL_SetHintWithPriority(SDL_HINT_RENDER_DIRECT3D_THREADSAFE, "1", SDL_HINT_OVERRIDE);
|
||||||
|
#endif
|
||||||
|
|
||||||
m_Renderer = SDL_CreateRenderer(window, -1, rendererFlags);
|
m_Renderer = SDL_CreateRenderer(window, -1, rendererFlags);
|
||||||
if (!m_Renderer) {
|
if (!m_Renderer) {
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
|
Loading…
Reference in a new issue