Bug 1395593 - Don't query the maximum channel count in ::PlayAudio using cubeb. r=achronop
☠☠ backed out by cc85091ab81c ☠ ☠
authorPaul Adenot <paul@paul.cx>
Thu, 31 Aug 2017 17:14:34 +0200
changeset 378020 eab0db5216b78b958d71d26d92d1f32adbdaec9c
parent 378019 5ffb2108ba511b94e52bd0686f29b71fe8bbe79d
child 378021 2e2062e0bc3691e9a85b0925a9055d0d51ca5935
push id32421
push userarchaeopteryx@coole-files.de
push dateFri, 01 Sep 2017 08:31:26 +0000
treeherdermozilla-central@583e73fb8e3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersachronop
bugs1395593
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 1395593 - Don't query the maximum channel count in ::PlayAudio using cubeb. r=achronop MozReview-Commit-ID: 97ri5vhzsRF
dom/media/GraphDriver.h
dom/media/MediaStreamGraph.cpp
--- a/dom/media/GraphDriver.h
+++ b/dom/media/GraphDriver.h
@@ -440,16 +440,22 @@ public:
     MOZ_ASSERT(OnThread());
     mAudioInput = nullptr;
   }
 
   AudioCallbackDriver* AsAudioCallbackDriver() override {
     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,
                                          void* aPromise,
                                          dom::AudioContextOperation aOperation);
 
   /**
    * Whether the audio callback is processing. This is for asserting only.
--- a/dom/media/MediaStreamGraph.cpp
+++ b/dom/media/MediaStreamGraph.cpp
@@ -943,17 +943,18 @@ MediaStreamGraphImpl::PlayAudio(MediaStr
         output.ApplyVolume(volume);
       }
       t = end;
     }
     audioOutput.mLastTickWritten = offset;
 
     // 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;
 }
 
 void
 MediaStreamGraphImpl::OpenAudioInputImpl(int aID,
                                          AudioDataListener *aListener)