Bug 1307223 - Don't warning multiple times about WMF dlls failing to load. r?cpearce draft
authorEric Rahm <erahm@mozilla.com>
Mon, 03 Oct 2016 14:02:15 -0700
changeset 420253 b3863bec6ec489a4886d702cb5e1e796ab35c057
parent 417649 c55bcb7c777ea09431b4d16903ed079ae5632648
child 532767 2bd1c4da87ec3c7c2dc69bb083e4eaa65debb1b9
push id31148
push usererahm@mozilla.com
push dateMon, 03 Oct 2016 21:03:19 +0000
reviewerscpearce
bugs1307223
milestone52.0a1
Bug 1307223 - Don't warning multiple times about WMF dlls failing to load. r?cpearce We already report failure in |LoadDlls| on the initial failure to load, there's no need to warn more than once per session. MozReview-Commit-ID: FhsR2ZaMSLT
dom/media/platforms/wmf/WMFUtils.cpp
--- a/dom/media/platforms/wmf/WMFUtils.cpp
+++ b/dom/media/platforms/wmf/WMFUtils.cpp
@@ -198,17 +198,19 @@ LoadDLLs()
 
 #define DECL_FUNCTION_PTR(FunctionName, ...) \
   typedef HRESULT (STDMETHODCALLTYPE * FunctionName##Ptr_t)(__VA_ARGS__)
 
 HRESULT
 MFStartup()
 {
   HRESULT hr = LoadDLLs();
-  NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
+  if (FAILED(hr)) {
+    return hr;
+  }
 
   const int MF_VISTA_VERSION = (0x0001 << 16 | MF_API_VERSION);
   const int MF_WIN7_VERSION = (0x0002 << 16 | MF_API_VERSION);
 
   // decltype is unusable for functions having default parameters
   DECL_FUNCTION_PTR(MFStartup, ULONG, DWORD);
   ENSURE_FUNCTION_PTR_(MFStartup, Mfplat.dll)
   if (!IsWin7OrLater())