Fixes a crash in VoE when unregistering JNI hooks.

BUG=11695087
R=andrew@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/3939004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5144 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrike@webrtc.org 2013-11-20 22:32:12 +00:00
parent 364f204d16
commit a750044396
3 changed files with 7 additions and 3 deletions

View File

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

View File

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

View File

@ -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(