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:
parent
c41fe5d5d0
commit
796e17237b
@ -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
|
||||
|
@ -93,17 +93,17 @@ class AudioManager {
|
||||
public:
|
||||
JavaAudioManager(NativeRegistration* native_registration,
|
||||
rtc::scoped_ptr<GlobalRef> audio_manager);
|
||||
~JavaAudioManager();
|
||||
~JavaAudioManager();
|
||||
|
||||
bool Init();
|
||||
void Close();
|
||||
void SetCommunicationMode(bool enable);
|
||||
bool Init();
|
||||
void Close();
|
||||
void SetCommunicationMode(bool enable);
|
||||
|
||||
private:
|
||||
rtc::scoped_ptr<GlobalRef> audio_manager_;
|
||||
jmethodID init_;
|
||||
jmethodID dispose_;
|
||||
jmethodID set_communication_mode_;
|
||||
private:
|
||||
rtc::scoped_ptr<GlobalRef> audio_manager_;
|
||||
jmethodID init_;
|
||||
jmethodID dispose_;
|
||||
jmethodID set_communication_mode_;
|
||||
};
|
||||
|
||||
AudioManager();
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user