mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-18 22:50:57 +00:00
Fix GetVideoProcessorCaps() failure handling
This commit is contained in:
@@ -268,7 +268,13 @@ bool DXVA2Renderer::initializeRenderer()
|
||||
|
||||
DXVA2_VideoProcessorCaps caps;
|
||||
hr = m_ProcService->GetVideoProcessorCaps(DXVA2_VideoProcProgressiveDevice, &m_Desc, renderTargetDesc.Format, &caps);
|
||||
if (SUCCEEDED(hr)) {
|
||||
if (FAILED(hr)) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"GetVideoProcessorCaps() failed for DXVA2_VideoProcProgressiveDevice: %x",
|
||||
hr);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(caps.DeviceCaps & DXVA2_VPDev_HardwareDevice)) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"DXVA2_VideoProcProgressiveDevice is not hardware: %x",
|
||||
@@ -292,7 +298,7 @@ bool DXVA2Renderer::initializeRenderer()
|
||||
|
||||
if (caps.DeviceCaps & DXVA2_VPDev_EmulatedDXVA1) {
|
||||
// DXVA2 over DXVA1 may have bad performance
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"DXVA2_VideoProcProgressiveDevice is DXVA1");
|
||||
}
|
||||
|
||||
@@ -308,12 +314,6 @@ bool DXVA2Renderer::initializeRenderer()
|
||||
hr);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"GetVideoProcessorCaps() failed for DXVA2_VideoProcProgressiveDevice: %x",
|
||||
hr);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user