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

Unified Diff: webrtc/modules/audio_device/android/opensles_player.cc

Issue 1305983003: Convert some more things to size_t. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Support Android's C89 mode 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
Index: webrtc/modules/audio_device/android/opensles_player.cc
diff --git a/webrtc/modules/audio_device/android/opensles_player.cc b/webrtc/modules/audio_device/android/opensles_player.cc
index 0789ebf1baaf9d6c39fb77e8acfadd272e7d0777..ceef9463b252861533f69b33bc6b5c85c7362a2c 100644
--- a/webrtc/modules/audio_device/android/opensles_player.cc
+++ b/webrtc/modules/audio_device/android/opensles_player.cc
@@ -14,6 +14,7 @@
#include "webrtc/base/arraysize.h"
#include "webrtc/base/checks.h"
+#include "webrtc/base/format_macros.h"
#include "webrtc/modules/audio_device/android/audio_manager.h"
#include "webrtc/modules/audio_device/android/fine_audio_buffer.h"
@@ -182,9 +183,10 @@ void OpenSLESPlayer::AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) {
AllocateDataBuffers();
}
-SLDataFormat_PCM OpenSLESPlayer::CreatePCMConfiguration(int channels,
- int sample_rate,
- int bits_per_sample) {
+SLDataFormat_PCM OpenSLESPlayer::CreatePCMConfiguration(
+ int channels,
+ int sample_rate,
+ size_t bits_per_sample) {
ALOGD("CreatePCMConfiguration");
CHECK_EQ(bits_per_sample, SL_PCMSAMPLEFORMAT_FIXED_16);
SLDataFormat_PCM format;
@@ -231,7 +233,7 @@ void OpenSLESPlayer::AllocateDataBuffers() {
DCHECK(!simple_buffer_queue_);
CHECK(audio_device_buffer_);
bytes_per_buffer_ = audio_parameters_.GetBytesPerBuffer();
- ALOGD("native buffer size: %d", bytes_per_buffer_);
+ ALOGD("native buffer size: %" PRIuS, bytes_per_buffer_);
// Create a modified audio buffer class which allows us to ask for any number
// of samples (and not only multiple of 10ms) to match the native OpenSL ES
// buffer size.
@@ -240,8 +242,8 @@ void OpenSLESPlayer::AllocateDataBuffers() {
audio_parameters_.sample_rate()));
// Each buffer must be of this size to avoid unnecessary memcpy while caching
// data between successive callbacks.
- const int required_buffer_size = fine_buffer_->RequiredBufferSizeBytes();
- ALOGD("required buffer size: %d", required_buffer_size);
+ const size_t required_buffer_size = fine_buffer_->RequiredBufferSizeBytes();
+ ALOGD("required buffer size: %" PRIuS, required_buffer_size);
for (int i = 0; i < kNumOfOpenSLESBuffers; ++i) {
audio_buffers_[i].reset(new SLint8[required_buffer_size]);
}
« no previous file with comments | « webrtc/modules/audio_device/android/opensles_player.h ('k') | webrtc/modules/audio_device/include/audio_device_defines.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698