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

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

Issue 1230503003: Update a ton of audio code to use size_t more correctly and in general reduce (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 3 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 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 582
583 // replace mixed audio with Dtmf tone 583 // replace mixed audio with Dtmf tone
584 if (_audioFrame.num_channels_ == 1) 584 if (_audioFrame.num_channels_ == 1)
585 { 585 {
586 // mono 586 // mono
587 memcpy(_audioFrame.data_, toneBuffer, sizeof(int16_t) 587 memcpy(_audioFrame.data_, toneBuffer, sizeof(int16_t)
588 * toneSamples); 588 * toneSamples);
589 } else 589 } else
590 { 590 {
591 // stereo 591 // stereo
592 for (int i = 0; i < _audioFrame.samples_per_channel_; i++) 592 for (size_t i = 0; i < _audioFrame.samples_per_channel_; i++)
593 { 593 {
594 _audioFrame.data_[2 * i] = toneBuffer[i]; 594 _audioFrame.data_[2 * i] = toneBuffer[i];
595 _audioFrame.data_[2 * i + 1] = 0; 595 _audioFrame.data_[2 * i + 1] = 0;
596 } 596 }
597 } 597 }
598 assert(_audioFrame.samples_per_channel_ == toneSamples); 598 assert(_audioFrame.samples_per_channel_ == toneSamples);
599 599
600 return 0; 600 return 0;
601 } 601 }
602 602
603 } // namespace voe 603 } // namespace voe
604 } // namespace webrtc 604 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/voice_engine/mock/fake_voe_external_media.h ('k') | webrtc/voice_engine/test/auto_test/fakes/fake_media_process.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698