Bug 1395195 - Restrict min number of channels on AudioCallbackDriver's helper buffers. r=padenot
authorAlex Chronopoulos <achronop@gmail.com>
Thu, 31 Aug 2017 16:43:01 +0300
changeset 378008 787441c9619d67540aaeb5bdafb0ddc88e654b7f
parent 378007 3f58f4dc8303cb08e66907b3d403e8d2a1cf3234
child 378009 7ee88ddf08f4a01bcb233bca1b5fcab8feaa92b4
push id50146
push userachronop@gmail.com
push dateThu, 31 Aug 2017 16:17:06 +0000
treeherderautoland@787441c9619d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1395195
milestone57.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 1395195 - Restrict min number of channels on AudioCallbackDriver's helper buffers. r=padenot MozReview-Commit-ID: 5eAhN4x6U4q
dom/media/GraphDriver.cpp
--- a/dom/media/GraphDriver.cpp
+++ b/dom/media/GraphDriver.cpp
@@ -556,18 +556,18 @@ StreamAndPromiseForOperation::StreamAndP
   , mOperation(aOperation)
 {
   // MOZ_ASSERT(aPromise);
 }
 
 AudioCallbackDriver::AudioCallbackDriver(MediaStreamGraphImpl* aGraphImpl)
   : GraphDriver(aGraphImpl)
   , mOuputChannels(mGraphImpl->AudioChannelCount())
-  , mScratchBuffer(mOuputChannels)
-  , mBuffer(mOuputChannels)
+  , mScratchBuffer(std::max<uint32_t>(1, mOuputChannels))
+  , mBuffer(std::max<uint32_t>(1, mOuputChannels))
   , mSampleRate(0)
   , mInputChannels(1)
   , mIterationDurationMS(MEDIA_GRAPH_TARGET_PERIOD_MS)
   , mStarted(false)
   , mAudioInput(nullptr)
   , mAddedMixer(false)
   , mInCallback(false)
   , mMicrophoneActive(false)