Bug 1423770 - r=padenot
authorAlex Chronopoulos <achronop@gmail.com>
Mon, 18 Dec 2017 15:20:06 +0100
changeset 448472 71637b33eae2145048b1dbec306b9ce4e5d8e863
parent 448471 d98062d7d66b702919e9f6aa23094465169bc43e
child 448473 12981d0630956bff62378600e011d3a396969590
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1423770
milestone59.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 1423770 - r=padenot
media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
--- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
+++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
@@ -552,24 +552,25 @@ public:
 
     uint32_t audio_10ms = rate / 100;
 
     if (!mPacketizer || mPacketizer->PacketSize() != audio_10ms ||
         mPacketizer->Channels() != outputChannels) {
       // It's ok to drop the audio still in the packetizer here.
       mPacketizer = MakeUnique<AudioPacketizer<int16_t, int16_t>>(
         audio_10ms, outputChannels);
+      mPacket = MakeUnique<int16_t[]>(audio_10ms * outputChannels);
     }
 
     mPacketizer->Input(samples, chunk.mDuration);
 
     while (mPacketizer->PacketsAvailable()) {
-      mPacketizer->Output(mPacket);
+      mPacketizer->Output(mPacket.get());
       mConduit->SendAudioFrame(
-        mPacket, mPacketizer->PacketSize(), rate, mPacketizer->Channels(), 0);
+        mPacket.get(), mPacketizer->PacketSize(), rate, mPacketizer->Channels(), 0);
     }
   }
 
   void QueueAudioChunk(TrackRate aRate, const AudioChunk& aChunk, bool aEnabled)
   {
     RefPtr<AudioProxyThread> self = this;
     nsresult rv = mTaskQueue->Dispatch(NS_NewRunnableFunction(
       "AudioProxyThread::QueueAudioChunk", [self, aRate, aChunk, aEnabled]() {
@@ -589,17 +590,17 @@ protected:
     MOZ_COUNT_DTOR(AudioProxyThread);
   }
 
   RefPtr<AudioSessionConduit> mConduit;
   const RefPtr<AutoTaskQueue> mTaskQueue;
   // Only accessed on mTaskQueue
   UniquePtr<AudioPacketizer<int16_t, int16_t>> mPacketizer;
   // A buffer to hold a single packet of audio.
-  int16_t mPacket[AUDIO_SAMPLE_BUFFER_MAX_BYTES / sizeof(int16_t)];
+  UniquePtr<int16_t[]> mPacket;
 };
 
 static char kDTLSExporterLabel[] = "EXTRACTOR-dtls_srtp";
 
 MediaPipeline::MediaPipeline(const std::string& aPc,
                              DirectionType aDirection,
                              nsCOMPtr<nsIEventTarget> aMainThread,
                              nsCOMPtr<nsIEventTarget> aStsThread,