Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Side by Side Diff: webrtc/voice_engine/output_mixer.cc

Issue 1224163002: Update audio code to use size_t more correctly, webrtc/voice_engine/ portion. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Checkpoint Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 614
615 // replace mixed audio with Dtmf tone 615 // replace mixed audio with Dtmf tone
616 if (_audioFrame.num_channels_ == 1) 616 if (_audioFrame.num_channels_ == 1)
617 { 617 {
618 // mono 618 // mono
619 memcpy(_audioFrame.data_, toneBuffer, sizeof(int16_t) 619 memcpy(_audioFrame.data_, toneBuffer, sizeof(int16_t)
620 * toneSamples); 620 * toneSamples);
621 } else 621 } else
622 { 622 {
623 // stereo 623 // stereo
624 for (int i = 0; i < _audioFrame.samples_per_channel_; i++) 624 for (size_t i = 0; i < _audioFrame.samples_per_channel_; i++)
625 { 625 {
626 _audioFrame.data_[2 * i] = toneBuffer[i]; 626 _audioFrame.data_[2 * i] = toneBuffer[i];
627 _audioFrame.data_[2 * i + 1] = 0; 627 _audioFrame.data_[2 * i + 1] = 0;
628 } 628 }
629 } 629 }
630 assert(_audioFrame.samples_per_channel_ == toneSamples); 630 assert(_audioFrame.samples_per_channel_ == toneSamples);
631 631
632 return 0; 632 return 0;
633 } 633 }
634 634
635 } // namespace voe 635 } // namespace voe
636 } // namespace webrtc 636 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698