author | Chris Pearce <cpearce@mozilla.com> |
Tue, 04 Oct 2016 16:05:53 +1300 | |
changeset 316376 | b60523131a1cf1265a08e7d88f4f2942b70a3659 |
parent 316375 | 114ae8fb1a77e97ef7415a4264928960a8e8c1b7 |
child 316377 | 2a1edf61eb2b6366e78729edb64289e936b03276 |
push id | 30770 |
push user | kwierso@gmail.com |
push date | Wed, 05 Oct 2016 00:00:48 +0000 |
treeherder | mozilla-central@3470e326025c [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | mattwoodrow |
bugs | 1279171 |
milestone | 52.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
dom/media/platforms/PDMFactory.cpp | file | annotate | diff | comparison | revisions | |
dom/media/platforms/wmf/WMFUtils.cpp | file | annotate | diff | comparison | revisions |
--- a/dom/media/platforms/PDMFactory.cpp +++ b/dom/media/platforms/PDMFactory.cpp @@ -41,16 +41,20 @@ #include "AgnosticDecoderModule.h" #include "EMEDecoderModule.h" #include "DecoderDoctorDiagnostics.h" #include "MP4Decoder.h" #include "mozilla/dom/RemoteVideoDecoder.h" +#ifdef XP_WIN +#include "mozilla/WindowsVersion.h" +#endif + #include "mp4_demuxer/H264.h" namespace mozilla { extern already_AddRefed<PlatformDecoderModule> CreateAgnosticDecoderModule(); extern already_AddRefed<PlatformDecoderModule> CreateBlankDecoderModule(); class PDMFactoryImpl final { @@ -313,17 +317,24 @@ PDMFactory::CreatePDMs() #ifdef MOZ_WIDGET_ANDROID if(MediaPrefs::PDMAndroidMediaCodecPreferred() && MediaPrefs::PDMAndroidMediaCodecEnabled()) { m = new AndroidDecoderModule(); StartupPDM(m); } #endif #ifdef XP_WIN - if (MediaPrefs::PDMWMFEnabled()) { + if (MediaPrefs::PDMWMFEnabled() && IsVistaOrLater()) { + // *Only* use WMF on Vista and later, as if Firefox is run in Windows 95 + // compatibility mode on Windows 7 (it does happen!) we may crash trying + // to startup WMF. So we need to detect the OS version here, as in + // compatibility mode IsVistaOrLater() and friends behave as if we're on + // the emulated version of Windows. See bug 1279171. + // Additionally, we don't want to start the RemoteDecoderModule if we + // expect it's not going to work (i.e. on Windows older than Vista). m = new WMFDecoderModule(); RefPtr<PlatformDecoderModule> remote = new dom::RemoteDecoderModule(m); mWMFFailedToLoad = !StartupPDM(remote); if (mWMFFailedToLoad) { mWMFFailedToLoad = !StartupPDM(m); } } else { mWMFFailedToLoad = MediaPrefs::DecoderDoctorWMFDisabledIsFailure();
--- a/dom/media/platforms/wmf/WMFUtils.cpp +++ b/dom/media/platforms/wmf/WMFUtils.cpp @@ -197,16 +197,25 @@ LoadDLLs() ENSURE_FUNCTION_PTR_HELPER(FunctionName##Ptr_t, FunctionName, DLL) \ #define DECL_FUNCTION_PTR(FunctionName, ...) \ typedef HRESULT (STDMETHODCALLTYPE * FunctionName##Ptr_t)(__VA_ARGS__) HRESULT MFStartup() { + if (!IsVistaOrLater()) { + // *Only* use WMF on Vista and later, as if Firefox is run in Windows 95 + // compatibility mode on Windows 7 (it does happen!) we may crash trying + // to startup WMF. So we need to detect the OS version here, as in + // compatibility mode IsVistaOrLater() and friends behave as if we're on + // the emulated version of Windows. See bug 1279171. + return E_FAIL; + } + HRESULT hr = LoadDLLs(); 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);