Bug 1240417. Part 2 - remove unused code. r=kinetik. draft
authorJW Wang <jwwang@mozilla.com>
Mon, 18 Jan 2016 11:25:27 +0800
changeset 322234 2809bf1cf2b48c1bdb3dfea2fc78c94fd34f24f9
parent 322233 b73013e201781a79ab83edc93696dffe615e402e
child 513070 87ff9f4f3ac3ff1d60e0c0fd9d4602921a551029
push id9569
push userjwwang@mozilla.com
push dateMon, 18 Jan 2016 06:21:23 +0000
reviewerskinetik
bugs1240417
milestone46.0a1
Bug 1240417. Part 2 - remove unused code. r=kinetik.
dom/media/AudioStream.cpp
dom/media/AudioStream.h
--- a/dom/media/AudioStream.cpp
+++ b/dom/media/AudioStream.cpp
@@ -122,17 +122,16 @@ AudioStream::AudioStream(DataSource& aSo
   : mMonitor("AudioStream")
   , mInRate(0)
   , mOutRate(0)
   , mChannels(0)
   , mOutChannels(0)
   , mAudioClock(this)
   , mTimeStretcher(nullptr)
   , mDumpFile(nullptr)
-  , mBytesPerFrame(0)
   , mState(INITIALIZED)
   , mIsMonoAudioEnabled(gfxPrefs::MonoAudio())
   , mDataSource(aSource)
 {
 }
 
 AudioStream::~AudioStream()
 {
@@ -334,17 +333,16 @@ AudioStream::Init(int32_t aNumChannels, 
     return NS_ERROR_INVALID_ARG;
   }
 #endif
   if (AUDIO_OUTPUT_FORMAT == AUDIO_FORMAT_S16) {
     params.format = CUBEB_SAMPLE_S16NE;
   } else {
     params.format = CUBEB_SAMPLE_FLOAT32NE;
   }
-  mBytesPerFrame = sizeof(AudioDataValue) * mOutChannels;
 
   mAudioClock.Init();
 
   return OpenCubeb(params);
 }
 
 // This code used to live inside AudioStream::Init(), but on Mac (others?)
 // it has been known to take 300-800 (or even 8500) ms to execute(!)
--- a/dom/media/AudioStream.h
+++ b/dom/media/AudioStream.h
@@ -347,28 +347,16 @@ private:
   TimeStamp mStartTime;
 
   // Output file for dumping audio
   FILE* mDumpFile;
 
   // Owning reference to a cubeb_stream.
   UniquePtr<cubeb_stream, CubebDestroyPolicy> mCubebStream;
 
-  uint32_t mBytesPerFrame;
-
-  uint32_t BytesToFrames(uint32_t aBytes) {
-    NS_ASSERTION(aBytes % mBytesPerFrame == 0,
-                 "Byte count not aligned on frames size.");
-    return aBytes / mBytesPerFrame;
-  }
-
-  uint32_t FramesToBytes(uint32_t aFrames) {
-    return aFrames * mBytesPerFrame;
-  }
-
   enum StreamState {
     INITIALIZED, // Initialized, playback has not begun.
     STARTED,     // cubeb started, but callbacks haven't started
     RUNNING,     // DataCallbacks have started after STARTED, or after Resume().
     STOPPED,     // Stopped by a call to Pause().
     DRAINED,     // StateCallback has indicated that the drain is complete.
     ERRORED,     // Stream disabled due to an internal error.
     SHUTDOWN     // Shutdown has been called