From 097de34e5b7e56970eddaa0a9f84dcfe6aa8549d Mon Sep 17 00:00:00 2001 From: Paul Adenot Date: Thu, 31 Aug 2017 17:14:34 +0200 Subject: [PATCH] Bug 1395593 - Don't query the maximum channel count in ::PlayAudio using cubeb. r=achronop MozReview-Commit-ID: 97ri5vhzsRF --HG-- extra : rebase_source : 56bc0f44566dfc3e271444f8dfc9f89e12a1a0a1 --- dom/media/GraphDriver.h | 6 ++++++ dom/media/MediaStreamGraph.cpp | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dom/media/GraphDriver.h b/dom/media/GraphDriver.h index 2f26e08acaba..67d2f9453ba9 100644 --- a/dom/media/GraphDriver.h +++ b/dom/media/GraphDriver.h @@ -445,6 +445,12 @@ public: return this; } + uint32_t OutputChannelCount() + { + MOZ_ASSERT(mOuputChannels != 0 && mOuputChannels <= 8); + return mOuputChannels; + } + /* Enqueue a promise that is going to be resolved when a specific operation * occurs on the cubeb stream. */ void EnqueueStreamAndPromiseForOperation(MediaStream* aStream, diff --git a/dom/media/MediaStreamGraph.cpp b/dom/media/MediaStreamGraph.cpp index 23944d56a768..b916f3089a54 100644 --- a/dom/media/MediaStreamGraph.cpp +++ b/dom/media/MediaStreamGraph.cpp @@ -948,7 +948,8 @@ MediaStreamGraphImpl::PlayAudio(MediaStream* aStream) // Need unique id for stream & track - and we want it to match the inserter output.WriteTo(LATENCY_STREAM_ID(aStream, track->GetID()), - mMixer, AudioChannelCount(), + mMixer, + CurrentDriver()->AsAudioCallbackDriver()->OutputChannelCount(), mSampleRate); } return ticksWritten;