Bug 1240417. Part 2 - remove unused code. r=kinetik.
--- 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