|
|
@@ -162,7 +162,13 @@ try {
|
|
|
throw "CreateDXGIFactory1 failed";
|
|
|
|
|
|
mfxLoader loader = MFXLoad();
|
|
|
+ if (!loader)
|
|
|
+ throw "MFXLoad failed";
|
|
|
+
|
|
|
mfxConfig cfg = MFXCreateConfig(loader);
|
|
|
+ if (!cfg)
|
|
|
+ throw "MFXCreateConfig failed";
|
|
|
+
|
|
|
mfxVariant impl;
|
|
|
|
|
|
// Low latency is disabled due to encoding capabilities not being provided before TGL for VPL
|
|
|
@@ -171,14 +177,16 @@ try {
|
|
|
MFXSetConfigFilterProperty(
|
|
|
cfg, (const mfxU8 *)"mfxImplDescription.Impl", impl);
|
|
|
|
|
|
- mfxSession m_session;
|
|
|
+ mfxSession m_session = nullptr;
|
|
|
mfxStatus sts = MFXCreateSession(loader, 0, &m_session);
|
|
|
|
|
|
uint32_t idx = 0;
|
|
|
while (get_adapter_caps(factory, loader, m_session, idx++) == true)
|
|
|
;
|
|
|
|
|
|
- MFXClose(m_session);
|
|
|
+ if (m_session)
|
|
|
+ MFXClose(m_session);
|
|
|
+
|
|
|
MFXUnload(loader);
|
|
|
|
|
|
for (auto &[idx, caps] : adapter_info) {
|