Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(772)

Unified Diff: content/common/gpu/media/dxva_video_decode_accelerator.cc

Issue 151993002: Probe whether MFPlat.dll is present on Windows systems. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/media/dxva_video_decode_accelerator.cc
diff --git a/content/common/gpu/media/dxva_video_decode_accelerator.cc b/content/common/gpu/media/dxva_video_decode_accelerator.cc
index 63f9d43e86cbd58aa829d2a9751272fb7d5256b3..38030305f0f6fed02a9eb789ebf49ae0aae3e99a 100644
--- a/content/common/gpu/media/dxva_video_decode_accelerator.cc
+++ b/content/common/gpu/media/dxva_video_decode_accelerator.cc
@@ -433,6 +433,14 @@ DXVAVideoDecodeAccelerator::~DXVAVideoDecodeAccelerator() {
bool DXVAVideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile) {
DCHECK(CalledOnValidThread());
+ // Not all versions of Windows 7 and later include Media Foundation DLLs.
+ // Instead of crashing while delay loading the DLL when calling MFStartup()
+ // below, probe whether we can successfully load the DLL now.
+ //
+ // See http://crbug.com/339678 for details.
+ HMODULE mfplat_dll = ::LoadLibrary(L"MFPlat.dll");
+ RETURN_ON_FAILURE(mfplat_dll, "MFPlat.dll is required for decoding", false);
+
// TODO(ananta)
// H264PROFILE_HIGH video decoding is janky at times. Needs more
// investigation.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698