Bug 1312431 - Make buffers passed into Get10msTone match specified maximum buffer size; r=jesup
authorDan Minor <dminor@mozilla.com>
Fri, 28 Oct 2016 08:58:19 -0400
changeset 320033 c136ac92dcdc37dfd09f4868887f1ccf86522989
parent 320032 9c1b8232382aea0f3443c87966f209c5a86e80ae
child 320034 fb2d15e4f33d8a643197563608d1c216691abb18
push id20749
push userryanvm@gmail.com
push dateSat, 29 Oct 2016 13:21:21 +0000
treeherderfx-team@1b170b39ed6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs1312431
milestone52.0a1
Bug 1312431 - Make buffers passed into Get10msTone match specified maximum buffer size; r=jesup MozReview-Commit-ID: I7UNWfzHi6I
media/webrtc/trunk/webrtc/voice_engine/channel.cc
media/webrtc/trunk/webrtc/voice_engine/output_mixer.cc
--- a/media/webrtc/trunk/webrtc/voice_engine/channel.cc
+++ b/media/webrtc/trunk/webrtc/voice_engine/channel.cc
@@ -3997,17 +3997,17 @@ Channel::InsertInbandDtmfTone()
             // has changed.
             _inbandDtmfGenerator.SetSampleRate(
                 (uint16_t) (_audioFrame.sample_rate_hz_));
             // Reset the tone to be added taking the new sample rate into
             // account.
             _inbandDtmfGenerator.ResetTone();
         }
 
-        int16_t toneBuffer[320];
+        int16_t toneBuffer[MAX_DTMF_SAMPLERATE/100];
         uint16_t toneSamples(0);
         // Get 10ms tone segment and set time since last tone to zero
         if (_inbandDtmfGenerator.Get10msTone(toneBuffer, toneSamples) == -1)
         {
             WEBRTC_TRACE(kTraceWarning, kTraceVoice,
                        VoEId(_instanceId, _channelId),
                        "Channel::EncodeAndSend() inserting Dtmf failed");
             return -1;
--- a/media/webrtc/trunk/webrtc/voice_engine/output_mixer.cc
+++ b/media/webrtc/trunk/webrtc/voice_engine/output_mixer.cc
@@ -619,17 +619,17 @@ OutputMixer::InsertInbandDtmfTone()
     {
         // Update sample rate of Dtmf tone since the mixing frequency changed.
         _dtmfGenerator.SetSampleRate(
             (uint16_t)(_audioFrame.sample_rate_hz_));
         // Reset the tone to be added taking the new sample rate into account.
         _dtmfGenerator.ResetTone();
     }
 
-    int16_t toneBuffer[320];
+    int16_t toneBuffer[MAX_DTMF_SAMPLERATE/100];
     uint16_t toneSamples(0);
     if (_dtmfGenerator.Get10msTone(toneBuffer, toneSamples) == -1)
     {
         WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, -1),
                      "OutputMixer::InsertInbandDtmfTone() inserting Dtmf"
                      "tone failed");
         return -1;
     }