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
This commit is contained in:
henrike@webrtc.org 2013-09-11 18:50:06 +00:00
parent 036b7436df
commit 6138c5cfa4
2 changed files with 2 additions and 6 deletions

View File

@ -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;
}

View File

@ -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) {