Bug 1395195 - Restrict min number of channels on AudioCallbackDriver's helper buffers. r?padenot
MozReview-Commit-ID: 5eAhN4x6U4q
--- 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)