diff --git a/libvpl/src/windows/mfx_library_iterator.cpp b/libvpl/src/windows/mfx_library_iterator.cpp index fa9fc73d..3bdc001e 100644 --- a/libvpl/src/windows/mfx_library_iterator.cpp +++ b/libvpl/src/windows/mfx_library_iterator.cpp @@ -619,9 +619,13 @@ mfxStatus MFXLibraryIterator::GetRegkeyDir(std::wstring ®Dir, size_t length, mfxStatus sts = MFX_ERR_UNSUPPORTED; MFX::MFXLibraryIterator libIterator; wchar_t wRegDir[MFX_MAX_DLL_PATH]; + int adapterNum = 0; regDir.clear(); - sts = libIterator.Init(MFX_LIB_HARDWARE, MFX_IMPL_VIA_D3D11, 0, storageID); + do { + sts = libIterator.Init(MFX_LIB_HARDWARE, MFX_IMPL_VIA_D3D11, adapterNum, storageID); + adapterNum++; + } while (sts == MFX_ERR_NONE && !libIterator.isIntelAdapter()); if (sts) return MFX_ERR_UNSUPPORTED; diff --git a/libvpl/src/windows/mfx_library_iterator.h b/libvpl/src/windows/mfx_library_iterator.h index 58b90966..2abfcc8e 100644 --- a/libvpl/src/windows/mfx_library_iterator.h +++ b/libvpl/src/windows/mfx_library_iterator.h @@ -99,6 +99,9 @@ class MFXLibraryIterator { mfxU32 deviceID, int storageID); static mfxStatus GetRegkeyDir(std::wstring ®Dir, size_t length, int storageID); + bool isIntelAdapter() const { + return m_vendorID == INTEL_VENDOR_ID; + } protected: // Release the iterator