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

Unified Diff: webrtc/voice_engine/channel.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, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/voice_engine/channel.h ('k') | webrtc/voice_engine/include/voe_external_media.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/voice_engine/channel.cc
diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc
index 9fe8f0e6b9e51c4e4df4b07b965a4573a369a635..c42ac0a9278c6aad1f3968ddecb9a32949792df1 100644
--- a/webrtc/voice_engine/channel.cc
+++ b/webrtc/voice_engine/channel.cc
@@ -3336,7 +3336,7 @@ Channel::Demultiplex(const AudioFrame& audioFrame)
void Channel::Demultiplex(const int16_t* audio_data,
int sample_rate,
- int number_of_frames,
+ size_t number_of_frames,
int number_of_channels) {
CodecInst codec;
GetSendCodec(codec);
@@ -3398,7 +3398,8 @@ Channel::PrepareEncodeAndSend(int mixingFrequency)
InsertInbandDtmfTone();
if (_includeAudioLevelIndication) {
- int length = _audioFrame.samples_per_channel_ * _audioFrame.num_channels_;
+ size_t length =
+ _audioFrame.samples_per_channel_ * _audioFrame.num_channels_;
if (is_muted) {
rms_level_.ProcessMuted(length);
} else {
@@ -3686,7 +3687,7 @@ int32_t
Channel::MixOrReplaceAudioWithFile(int mixingFrequency)
{
rtc::scoped_ptr<int16_t[]> fileBuffer(new int16_t[640]);
- int fileSamples(0);
+ size_t fileSamples(0);
{
CriticalSectionScoped cs(&_fileCritSect);
@@ -3756,7 +3757,7 @@ Channel::MixAudioWithFile(AudioFrame& audioFrame,
assert(mixingFrequency <= 48000);
rtc::scoped_ptr<int16_t[]> fileBuffer(new int16_t[960]);
- int fileSamples(0);
+ size_t fileSamples(0);
{
CriticalSectionScoped cs(&_fileCritSect);
@@ -3794,8 +3795,8 @@ Channel::MixAudioWithFile(AudioFrame& audioFrame,
else
{
WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId,_channelId),
- "Channel::MixAudioWithFile() samples_per_channel_(%d) != "
- "fileSamples(%d)",
+ "Channel::MixAudioWithFile() samples_per_channel_(%" PRIuS ") != "
+ "fileSamples(%" PRIuS ")",
audioFrame.samples_per_channel_, fileSamples);
return -1;
}
@@ -3855,7 +3856,7 @@ Channel::InsertInbandDtmfTone()
}
// Replace mixed audio with DTMF tone.
- for (int sample = 0;
+ for (size_t sample = 0;
sample < _audioFrame.samples_per_channel_;
sample++)
{
@@ -3863,7 +3864,8 @@ Channel::InsertInbandDtmfTone()
channel < _audioFrame.num_channels_;
channel++)
{
- const int index = sample * _audioFrame.num_channels_ + channel;
+ const size_t index =
+ sample * _audioFrame.num_channels_ + channel;
_audioFrame.data_[index] = toneBuffer[sample];
}
}
« no previous file with comments | « webrtc/voice_engine/channel.h ('k') | webrtc/voice_engine/include/voe_external_media.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698