Fix GetVideoProcessorCaps() failure handling

This commit is contained in:
Cameron Gutman
2018-09-21 17:29:53 -07:00
parent f96911e1ba
commit af9fb0e091
@@ -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;
} }