diff --git a/webrtc/modules/audio_device/android/opensles_input.cc b/webrtc/modules/audio_device/android/opensles_input.cc index e846685419..ef6e7b6228 100644 --- a/webrtc/modules/audio_device/android/opensles_input.cc +++ b/webrtc/modules/audio_device/android/opensles_input.cc @@ -367,7 +367,7 @@ void OpenSlesInput::DestroyAudioRecorder() { } sles_recorder_itf_ = NULL; - if (!sles_recorder_) { + if (sles_recorder_) { (*sles_recorder_)->Destroy(sles_recorder_); sles_recorder_ = NULL; } diff --git a/webrtc/modules/audio_device/android/opensles_output.cc b/webrtc/modules/audio_device/android/opensles_output.cc index 24504f8e72..882440e4fb 100644 --- a/webrtc/modules/audio_device/android/opensles_output.cc +++ b/webrtc/modules/audio_device/android/opensles_output.cc @@ -109,6 +109,7 @@ int32_t OpenSlesOutput::Init() { int32_t OpenSlesOutput::Terminate() { // It is assumed that the caller has stopped recording before terminating. assert(!playing_); + (*sles_output_mixer_)->Destroy(sles_output_mixer_); (*sles_engine_)->Destroy(sles_engine_); initialized_ = false; speaker_initialized_ = false; @@ -436,11 +437,6 @@ void OpenSlesOutput::DestroyAudioPlayer() { (*sles_player_)->Destroy(sles_player_); sles_player_ = NULL; } - - if (sles_output_mixer_) { - (*sles_output_mixer_)->Destroy(sles_output_mixer_); - sles_output_mixer_ = NULL; - } } bool OpenSlesOutput::HandleUnderrun(int event_id, int event_msg) {