From 6138c5cfa4bebc4eee645152095f93904a4fc524 Mon Sep 17 00:00:00 2001 From: "henrike@webrtc.org" Date: Wed, 11 Sep 2013 18:50:06 +0000 Subject: [PATCH] OpenSl: fixes crashes externally reported in issue 2361 and 2362. BUG=2361,2362 R=fischman@webrtc.org Review URL: https://webrtc-codereview.appspot.com/2196008 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4726 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/modules/audio_device/android/opensles_input.cc | 2 +- webrtc/modules/audio_device/android/opensles_output.cc | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) 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) {