Bug 726903 - Remove force_stereo_mode pref hack. r=roc
authorMatthew Gregan <kinetik@flim.org>
Thu, 24 May 2012 14:40:09 +1200
changeset 94774 078b97f40be30f82db9669cf202f2914da1121c1
parent 94773 896980f8fc27560701b5723b41019b78f53fe52c
child 94775 8d4521e975c82e3c4e3fc2abdf376a066b4a9814
push id9794
push usermgregan@mozilla.com
push dateThu, 24 May 2012 02:42:53 +0000
treeherdermozilla-inbound@078b97f40be3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs726903
milestone15.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 726903 - Remove force_stereo_mode pref hack. r=roc
content/media/webm/nsWebMReader.cpp
content/media/webm/nsWebMReader.h
--- a/content/media/webm/nsWebMReader.cpp
+++ b/content/media/webm/nsWebMReader.cpp
@@ -6,17 +6,16 @@
 #include "nsError.h"
 #include "nsBuiltinDecoderStateMachine.h"
 #include "nsBuiltinDecoder.h"
 #include "MediaResource.h"
 #include "nsWebMReader.h"
 #include "nsWebMBufferedParser.h"
 #include "VideoUtils.h"
 #include "nsTimeRanges.h"
-#include "mozilla/Preferences.h"
 
 #define VPX_DONT_DEFINE_STDINT_TYPES
 #include "vpx/vp8dx.h"
 #include "vpx/vpx_decoder.h"
 
 using namespace mozilla;
 using namespace mozilla::layers;
 
@@ -103,27 +102,20 @@ nsWebMReader::nsWebMReader(nsBuiltinDeco
   : nsBuiltinDecoderReader(aDecoder),
   mContext(nsnull),
   mPacketCount(0),
   mChannels(0),
   mVideoTrack(0),
   mAudioTrack(0),
   mAudioStartUsec(-1),
   mAudioFrames(0),
-  mForceStereoMode(0),
   mHasVideo(false),
-  mHasAudio(false),
-  mStereoModeForced(false)
+  mHasAudio(false)
 {
   MOZ_COUNT_CTOR(nsWebMReader);
-
-  mStereoModeForced =
-    NS_SUCCEEDED(Preferences::GetInt(
-          "media.webm.force_stereo_mode",
-          &mForceStereoMode));
 }
 
 nsWebMReader::~nsWebMReader()
 {
   Cleanup();
 
   mVideoPackets.Reset();
   mAudioPackets.Reset();
@@ -279,36 +271,16 @@ nsresult nsWebMReader::ReadMetadata(nsVi
         break;
       case NESTEGG_VIDEO_STEREO_TOP_BOTTOM:
         mInfo.mStereoMode = STEREO_MODE_TOP_BOTTOM;
         break;
       case NESTEGG_VIDEO_STEREO_RIGHT_LEFT:
         mInfo.mStereoMode = STEREO_MODE_RIGHT_LEFT;
         break;
       }
-
-      // Switch only when stereo mode is explicitly set.
-      if (mStereoModeForced) {
-        switch (mForceStereoMode) {
-        case 1:
-          mInfo.mStereoMode = STEREO_MODE_LEFT_RIGHT;
-          break;
-        case 2:
-          mInfo.mStereoMode = STEREO_MODE_RIGHT_LEFT;
-          break;
-        case 3:
-          mInfo.mStereoMode = STEREO_MODE_TOP_BOTTOM;
-          break;
-        case 4:
-          mInfo.mStereoMode = STEREO_MODE_BOTTOM_TOP;
-          break;
-        default:
-          mInfo.mStereoMode = STEREO_MODE_MONO;
-        }
-      }
     }
     else if (!mHasAudio && type == NESTEGG_TRACK_AUDIO) {
       nestegg_audio_params params;
       r = nestegg_track_audio_params(mContext, track, &params);
       if (r == -1) {
         Cleanup();
         return NS_ERROR_FAILURE;
       }
--- a/content/media/webm/nsWebMReader.h
+++ b/content/media/webm/nsWebMReader.h
@@ -202,22 +202,14 @@ private:
 
   // Size of the frame initially present in the stream. The picture region
   // is defined as a ratio relative to this.
   nsIntSize mInitialFrame;
 
   // Picture region, as relative to the initial frame size.
   nsIntRect mPicture;
 
-  // Value of the "media.webm.force_stereo_mode" pref, which we need off the
-  // main thread.
-  PRInt32 mForceStereoMode;
-
   // Booleans to indicate if we have audio and/or video data
   bool mHasVideo;
   bool mHasAudio;
-
-  // Boolean which is set to true when the "media.webm.force_stereo_mode"
-  // pref is explicitly set.
-  bool mStereoModeForced;
 };
 
 #endif