Bug 1253959 - per comment 5, remove code that causes ReadMetadata() to fail on Windows XP debug. r=cpearce. draft
authorJW Wang <jwwang@mozilla.com>
Mon, 07 Mar 2016 16:07:14 +0800
changeset 337537 621c7c96c9329b0117ba8dcbfd29b67f95072e95
parent 337307 3ab95a67a8a571d533f56b6976a1a7e6f34f01b3
child 337538 7f3fa016f09ade2459e4674abb6bc889eb26a9df
push id12386
push userjwwang@mozilla.com
push dateMon, 07 Mar 2016 23:25:41 +0000
reviewerscpearce
bugs1253959
milestone47.0a1
Bug 1253959 - per comment 5, remove code that causes ReadMetadata() to fail on Windows XP debug. r=cpearce. MozReview-Commit-ID: OmlMi4OHGE
dom/media/directshow/DirectShowReader.cpp
dom/media/directshow/DirectShowReader.h
--- a/dom/media/directshow/DirectShowReader.cpp
+++ b/dom/media/directshow/DirectShowReader.cpp
@@ -23,37 +23,29 @@ GetDirectShowLog() {
   return log;
 }
 
 #define LOG(...) MOZ_LOG(GetDirectShowLog(), mozilla::LogLevel::Debug, (__VA_ARGS__))
 
 DirectShowReader::DirectShowReader(AbstractMediaDecoder* aDecoder)
   : MediaDecoderReader(aDecoder),
     mMP3FrameParser(aDecoder->GetResource()->GetLength()),
-#ifdef DEBUG
-    mRotRegister(0),
-#endif
     mNumChannels(0),
     mAudioRate(0),
     mBytesPerSample(0),
     mDuration(0)
 {
   MOZ_ASSERT(NS_IsMainThread(), "Must be on main thread.");
   MOZ_COUNT_CTOR(DirectShowReader);
 }
 
 DirectShowReader::~DirectShowReader()
 {
   MOZ_ASSERT(NS_IsMainThread(), "Must be on main thread.");
   MOZ_COUNT_DTOR(DirectShowReader);
-#ifdef DEBUG
-  if (mRotRegister) {
-    RemoveGraphFromRunningObjectTable(mRotRegister);
-  }
-#endif
 }
 
 // Try to parse the MP3 stream to make sure this is indeed an MP3, get the
 // estimated duration of the stream, and find the offset of the actual MP3
 // frames in the stream, as DirectShow doesn't like large ID3 sections.
 static nsresult
 ParseMP3Headers(MP3FrameParser *aParser, MediaResource *aResource)
 {
@@ -99,25 +91,16 @@ DirectShowReader::ReadMetadata(MediaInfo
                         CLSCTX_INPROC_SERVER,
                         IID_IGraphBuilder,
                         reinterpret_cast<void**>(static_cast<IGraphBuilder**>(getter_AddRefs(mGraph))));
   NS_ENSURE_TRUE(SUCCEEDED(hr) && mGraph, NS_ERROR_FAILURE);
 
   rv = ParseMP3Headers(&mMP3FrameParser, mDecoder->GetResource());
   NS_ENSURE_SUCCESS(rv, rv);
 
-  #ifdef DEBUG
-  // Add the graph to the Running Object Table so that we can connect
-  // to this graph with GraphEdit/GraphStudio. Note: on Vista and up you must
-  // also regsvr32 proppage.dll from the Windows SDK.
-  // See: http://msdn.microsoft.com/en-us/library/ms787252(VS.85).aspx
-  hr = AddGraphToRunningObjectTable(mGraph, &mRotRegister);
-  NS_ENSURE_TRUE(SUCCEEDED(hr), NS_ERROR_FAILURE);
-  #endif
-
   // Extract the interface pointers we'll need from the filter graph.
   hr = mGraph->QueryInterface(static_cast<IMediaControl**>(getter_AddRefs(mControl)));
   NS_ENSURE_TRUE(SUCCEEDED(hr) && mControl, NS_ERROR_FAILURE);
 
   hr = mGraph->QueryInterface(static_cast<IMediaSeeking**>(getter_AddRefs(mMediaSeeking)));
   NS_ENSURE_TRUE(SUCCEEDED(hr) && mMediaSeeking, NS_ERROR_FAILURE);
 
   // Build the graph. Create the filters we need, and connect them. We
--- a/dom/media/directshow/DirectShowReader.h
+++ b/dom/media/directshow/DirectShowReader.h
@@ -78,23 +78,16 @@ private:
   // The graph will block while this is blocked, i.e. it will pause decoding.
   RefPtr<AudioSinkFilter> mAudioSinkFilter;
 
   // Some MP3s are variable bitrate, so DirectShow's duration estimation
   // can make its duration estimation based on the wrong bitrate. So we parse
   // the MP3 frames to get a more accuate estimate of the duration.
   MP3FrameParser mMP3FrameParser;
 
-#ifdef DEBUG
-  // Used to add/remove the filter graph to the Running Object Table. You can
-  // connect GraphEdit/GraphStudio to the graph to observe and/or debug its
-  // topology and state.
-  DWORD mRotRegister;
-#endif
-
   // Number of channels in the audio stream.
   uint32_t mNumChannels;
 
   // Samples per second in the audio stream.
   uint32_t mAudioRate;
 
   // Number of bytes per sample. Can be either 1 or 2.
   uint32_t mBytesPerSample;