Bug 930372 - Use WMF instead of DirectShow for MP3 decoding on Vista and later, to avoid regressing duration calculation. r=padenot
authorChris Pearce <cpearce@mozilla.com>
Fri, 25 Oct 2013 09:43:17 +1300
changeset 152010 0d86150342ca4f4b07c5096ed29e60d8b94b4ef2
parent 152009 5775bf2165d2caef104734dbd722b089e9e70b69
child 152011 fe02ce23c1309170dd8d96f310532e166d69218c
push id35398
push usercpearce@mozilla.com
push dateThu, 24 Oct 2013 20:45:45 +0000
treeherdermozilla-inbound@0d86150342ca [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs930372
milestone27.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
Bug 930372 - Use WMF instead of DirectShow for MP3 decoding on Vista and later, to avoid regressing duration calculation. r=padenot
content/media/directshow/DirectShowDecoder.cpp
--- a/content/media/directshow/DirectShowDecoder.cpp
+++ b/content/media/directshow/DirectShowDecoder.cpp
@@ -3,16 +3,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "DirectShowDecoder.h"
 #include "DirectShowReader.h"
 #include "MediaDecoderStateMachine.h"
 #include "mozilla/Preferences.h"
+#include "WinUtils.h"
+
+using namespace mozilla::widget;
 
 namespace mozilla {
 
 MediaDecoderStateMachine* DirectShowDecoder::CreateStateMachine()
 {
   return new MediaDecoderStateMachine(this, new DirectShowReader(this));
 }
 
@@ -39,17 +42,18 @@ DirectShowDecoder::GetSupportedCodecs(co
 
   return false;
 }
 
 /* static */
 bool
 DirectShowDecoder::IsEnabled()
 {
-  return Preferences::GetBool("media.directshow.enabled");
+  return (WinUtils::GetWindowsVersion() < WinUtils::VISTA_VERSION) &&
+          Preferences::GetBool("media.directshow.enabled");
 }
 
 DirectShowDecoder::DirectShowDecoder()
 {
   MOZ_COUNT_CTOR(DirectShowDecoder);
 }
 
 DirectShowDecoder::~DirectShowDecoder()