Bug 1423770. r=padenot, a=jcristau
authorAlex Chronopoulos <achronop@gmail.com>
Wed, 20 Dec 2017 09:21:40 -0500
changeset 445399 c4f1df0162ae7fa631bf8e983967df3904a6e598
parent 445398 3db9f0dfe9aafcd32fdb9803b685ebb49b39121d
child 445400 fd15d342e90e7cdebef991521f75e49464d23439
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot, jcristau
bugs1423770
milestone58.0
Bug 1423770. r=padenot, a=jcristau
media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
--- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
+++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
@@ -515,23 +515,24 @@ public:
 
     uint32_t audio_10ms = rate / 100;
 
     if (!packetizer_ ||
         packetizer_->PacketSize() != audio_10ms ||
         packetizer_->Channels() != outputChannels) {
       // It's ok to drop the audio still in the packetizer here.
       packetizer_ = new AudioPacketizer<int16_t, int16_t>(audio_10ms, outputChannels);
+      packet_ = MakeUnique<int16_t[]>(audio_10ms * outputChannels);
     }
 
     packetizer_->Input(samples, chunk.mDuration);
 
     while (packetizer_->PacketsAvailable()) {
-      packetizer_->Output(packet_);
-      mConduit->SendAudioFrame(packet_, packetizer_->PacketSize(), rate, packetizer_->Channels(), 0);
+      packetizer_->Output(packet_.get());
+      mConduit->SendAudioFrame(packet_.get(), packetizer_->PacketSize(), rate, packetizer_->Channels(), 0);
     }
   }
 
   void QueueAudioChunk(TrackRate rate, AudioChunk& chunk, bool enabled)
   {
     RUN_ON_THREAD(mThread,
                   WrapRunnable(RefPtr<AudioProxyThread>(this),
                                &AudioProxyThread::InternalProcessAudioChunk,
@@ -550,17 +551,17 @@ protected:
     MOZ_COUNT_DTOR(AudioProxyThread);
   }
 
   RefPtr<AudioSessionConduit> mConduit;
   nsCOMPtr<nsIEventTarget> mThread;
   // Only accessed on mThread
   nsAutoPtr<AudioPacketizer<int16_t, int16_t>> packetizer_;
   // A buffer to hold a single packet of audio.
-  int16_t packet_[AUDIO_SAMPLE_BUFFER_MAX_BYTES / sizeof(int16_t)];
+  UniquePtr<int16_t[]> packet_;
 };
 
 static char kDTLSExporterLabel[] = "EXTRACTOR-dtls_srtp";
 
 MediaPipeline::MediaPipeline(const std::string& pc,
                              Direction direction,
                              nsCOMPtr<nsIEventTarget> main_thread,
                              nsCOMPtr<nsIEventTarget> sts_thread,