Fixes crash in WebRtcAudioManager.setCommunicationMode

BUG=b/21360598
R=tommi@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/53579004

Cr-Commit-Position: refs/heads/master@{#9311}
This commit is contained in:
henrika 2015-05-28 14:18:33 +02:00
parent c41fe5d5d0
commit 796e17237b
3 changed files with 16 additions and 12 deletions

View File

@ -51,7 +51,8 @@ void AudioManager::JavaAudioManager::Close() {
}
void AudioManager::JavaAudioManager::SetCommunicationMode(bool enable) {
audio_manager_->CallVoidMethod(set_communication_mode_, enable);
audio_manager_->CallVoidMethod(set_communication_mode_,
static_cast<jboolean>(enable));
}
// AudioManager implementation

View File

@ -40,7 +40,9 @@ AudioRecordJni::JavaAudioRecord::~JavaAudioRecord() {}
int AudioRecordJni::JavaAudioRecord::InitRecording(
int sample_rate, int channels) {
return audio_record_->CallIntMethod(init_recording_, sample_rate, channels);
return audio_record_->CallIntMethod(init_recording_,
static_cast<jint>(sample_rate),
static_cast<jint>(channels));
}
bool AudioRecordJni::JavaAudioRecord::StartRecording() {
@ -52,7 +54,8 @@ bool AudioRecordJni::JavaAudioRecord::StopRecording() {
}
bool AudioRecordJni::JavaAudioRecord::EnableBuiltInAEC(bool enable) {
return audio_record_->CallBooleanMethod(enable_built_in_aec_, enable);
return audio_record_->CallBooleanMethod(enable_built_in_aec_,
static_cast<jboolean>(enable));
}
// AudioRecordJni implementation.