Bug 1394589: Load AMD VP9 decoder using CLSID. r?cpearce
MozReview-Commit-ID: xrUywFk4bu
--- a/dom/media/platforms/wmf/WMFVideoMFTManager.cpp
+++ b/dom/media/platforms/wmf/WMFVideoMFTManager.cpp
@@ -522,26 +522,32 @@ WMFVideoMFTManager::ValidateVideoInfo()
}
already_AddRefed<MFTDecoder>
WMFVideoMFTManager::LoadAMDVP9Decoder()
{
MOZ_ASSERT(mStreamType == VP9);
RefPtr<MFTDecoder> decoder = new MFTDecoder();
- // Check if we can load the AMD VP9 decoder.
+
+ HRESULT hr = decoder->Create(CLSID_AMDWebmMfVp9Dec);
+ if (SUCCEEDED(hr)) {
+ return decoder.forget();
+ }
+
+ // Check if we can load the AMD VP9 decoder using the path name.
nsString path = GetProgramW6432Path();
path.Append(kAMDVPXDecoderDLLPath);
path.Append(kAMDVP9DecoderDLLName);
HMODULE decoderDLL = ::LoadLibraryEx(path.get(), NULL,
LOAD_WITH_ALTERED_SEARCH_PATH);
if (!decoderDLL) {
return nullptr;
}
- HRESULT hr = decoder->Create(decoderDLL, CLSID_AMDWebmMfVp9Dec);
+ hr = decoder->Create(decoderDLL, CLSID_AMDWebmMfVp9Dec);
NS_ENSURE_TRUE(SUCCEEDED(hr), nullptr);
return decoder.forget();
}
bool
WMFVideoMFTManager::Init()
{
if (!ValidateVideoInfo()) {