mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-10-25 21:40:06 +00:00
Add some missing error handling
This commit is contained in:
1 parent
ba700d67ec
commit
d606709d83
1 file changed
+8
-1
@@ -426,7 +426,13 @@ bool DXVA2Renderer::initializeDevice(SDL_Window* window, bool enableVsync)
|
|||||||
|
|
||||||
D3DDISPLAYMODEEX currentMode;
|
D3DDISPLAYMODEEX currentMode;
|
||||||
currentMode.Size = sizeof(currentMode);
|
currentMode.Size = sizeof(currentMode);
|
||||||
d3d9ex->GetAdapterDisplayModeEx(adapterIndex, ¤tMode, nullptr);
|
hr = d3d9ex->GetAdapterDisplayModeEx(adapterIndex, ¤tMode, nullptr);
|
||||||
|
if (FAILED(hr)) {
|
||||||
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
"GetAdapterDisplayModeEx() failed: %x",
|
||||||
|
hr);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
D3DPRESENT_PARAMETERS d3dpp = {};
|
D3DPRESENT_PARAMETERS d3dpp = {};
|
||||||
d3dpp.hDeviceWindow = info.info.win.window;
|
d3dpp.hDeviceWindow = info.info.win.window;
|
||||||
@@ -987,6 +993,7 @@ void DXVA2Renderer::renderFrame(AVFrame *frame)
|
|||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"StretchRect() failed: %x",
|
"StretchRect() failed: %x",
|
||||||
hr);
|
hr);
|
||||||
|
m_Device->EndScene();
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
event.type = SDL_RENDER_DEVICE_RESET;
|
event.type = SDL_RENDER_DEVICE_RESET;
|
||||||
SDL_PushEvent(&event);
|
SDL_PushEvent(&event);
|
||||||
|
|||||||
Reference in new issue
Block a user