Bug 1368837 - WaveTrackDemuxer should copy the MediaResource* instead of a whole MediaResourceIndex - r=cpearce
authorGerald Squelart <gsquelart@mozilla.com>
Tue, 30 May 2017 21:42:22 +1200
changeset 409837 9b1ef0d8d9605c49a7a96214107be59d94a227dd
parent 409836 2f9a486c2dbbfce70a97ea9ae2832ed9fac0f266
child 409838 b9d2d284df0d2224049140932cf0e4d9fe2f702d
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1368837
milestone55.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 1368837 - WaveTrackDemuxer should copy the MediaResource* instead of a whole MediaResourceIndex - r=cpearce When the WaveTrackDemuxer is given a MediaResourceIndex, it's only really interested in the MediaResource pointer, so we should just pass that, and WaveTrackDemuxer can construct its own MediaResourceIndex from it. Also, MediaResourceIndex will become non-copyable soon. MozReview-Commit-ID: H0VGSxpAGkP
dom/media/wave/WaveDemuxer.cpp
dom/media/wave/WaveDemuxer.h
--- a/dom/media/wave/WaveDemuxer.cpp
+++ b/dom/media/wave/WaveDemuxer.cpp
@@ -28,17 +28,17 @@ WAVDemuxer::WAVDemuxer(MediaResource* aS
   : mSource(aSource)
 {
 }
 
 bool
 WAVDemuxer::InitInternal()
 {
   if (!mTrackDemuxer) {
-    mTrackDemuxer = new WAVTrackDemuxer(mSource);
+    mTrackDemuxer = new WAVTrackDemuxer(mSource.GetResource());
   }
   return mTrackDemuxer->Init();
 }
 
 RefPtr<WAVDemuxer::InitPromise>
 WAVDemuxer::Init()
 {
   if (!InitInternal()) {
@@ -72,17 +72,17 @@ WAVDemuxer::GetTrackDemuxer(TrackInfo::T
 bool
 WAVDemuxer::IsSeekable() const
 {
   return true;
 }
 
 // WAVTrackDemuxer
 
-WAVTrackDemuxer::WAVTrackDemuxer(MediaResourceIndex aSource)
+WAVTrackDemuxer::WAVTrackDemuxer(MediaResource* aSource)
   : mSource(aSource)
   , mOffset(0)
   , mFirstChunkOffset(0)
   , mNumParsedChunks(0)
   , mChunkIndex(0)
   , mTotalChunkLen(0)
   , mSamplesPerChunk(0)
   , mSamplesPerSecond(0)
--- a/dom/media/wave/WaveDemuxer.h
+++ b/dom/media/wave/WaveDemuxer.h
@@ -179,17 +179,17 @@ private:
   };
 
   DataChunk mChunk;
 };
 
 class WAVTrackDemuxer : public MediaTrackDemuxer
 {
 public:
-  explicit WAVTrackDemuxer(MediaResourceIndex aSource);
+  explicit WAVTrackDemuxer(MediaResource* aSource);
 
   bool Init();
 
   int64_t StreamLength() const;
 
   media::TimeUnit Duration() const;
   media::TimeUnit Duration(int64_t aNumDataChunks) const;
   media::TimeUnit DurationFromBytes(uint32_t aNumBytes) const;