Bug 930372 - Use WMF instead of DirectShow for MP3 decoding on Vista and later, to avoid regressing duration calculation. r=?
authorChris Pearce <cpearce@mozilla.com>
Wed, 23 Oct 2013 21:17:00 +0100
changeset 160911 ea1effdfb89cdae35db3a5898401c2e6d08b810e
parent 160910 f3de4be1d6a5488539ebd1ac5811845bf89afaa9
child 160912 0fcff6f948f6010e9d0306946b976a02b70e378d
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs930372
milestone26.0a2
Bug 930372 - Use WMF instead of DirectShow for MP3 decoding on Vista and later, to avoid regressing duration calculation. r=?
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()