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