diff --git a/webrtc/modules/audio_device/android/opensles_input.cc b/webrtc/modules/audio_device/android/opensles_input.cc index 9f58205a9..5bce5392f 100644 --- a/webrtc/modules/audio_device/android/opensles_input.cc +++ b/webrtc/modules/audio_device/android/opensles_input.cc @@ -126,7 +126,6 @@ int32_t OpenSlesInput::RecordingIsAvailable(bool& available) { // NOLINT int32_t OpenSlesInput::InitRecording() { assert(initialized_); - assert(!rec_initialized_); rec_initialized_ = true; return 0; } @@ -165,6 +164,7 @@ int32_t OpenSlesInput::StartRecording() { int32_t OpenSlesInput::StopRecording() { StopCbThreads(); DestroyAudioRecorder(); + recording_ = false; return 0; } diff --git a/webrtc/modules/audio_device/android/opensles_output.cc b/webrtc/modules/audio_device/android/opensles_output.cc index 882440e4f..f264f21ba 100644 --- a/webrtc/modules/audio_device/android/opensles_output.cc +++ b/webrtc/modules/audio_device/android/opensles_output.cc @@ -139,7 +139,6 @@ int32_t OpenSlesOutput::PlayoutIsAvailable(bool& available) { // NOLINT int32_t OpenSlesOutput::InitPlayout() { assert(initialized_); - assert(!play_initialized_); play_initialized_ = true; return 0; } @@ -176,6 +175,7 @@ int32_t OpenSlesOutput::StartPlayout() { int32_t OpenSlesOutput::StopPlayout() { StopCbThreads(); DestroyAudioPlayer(); + playing_ = false; return 0; } diff --git a/webrtc/voice_engine/voice_engine_impl.cc b/webrtc/voice_engine/voice_engine_impl.cc index 703b6a447..4af15f9a3 100644 --- a/webrtc/voice_engine/voice_engine_impl.cc +++ b/webrtc/voice_engine/voice_engine_impl.cc @@ -149,7 +149,11 @@ int VoiceEngine::SetAndroidObjects(void* javaVM, void* env, void* context) { #ifdef WEBRTC_ANDROID #ifdef WEBRTC_ANDROID_OPENSLES - AudioManagerJni::SetAndroidAudioDeviceObjects(javaVM, env, context); + if (javaVM && env && context) { + AudioManagerJni::SetAndroidAudioDeviceObjects(javaVM, env, context); + } else { + AudioManagerJni::ClearAndroidAudioDeviceObjects(); + } return 0; #else return AudioDeviceAndroidJni::SetAndroidAudioDeviceObjects(