Android, OpenSlDemo: fixes issue where app would crash as soon as the application is started.
BUG=2801 R=fischman@webrtc.org Review URL: https://webrtc-codereview.appspot.com/7259005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5398 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -63,14 +63,6 @@ class OpenSlRunnerTemplate {
|
||||
audio_buffer_.ClearBuffer();
|
||||
}
|
||||
|
||||
void RegisterApplicationContext(
|
||||
JNIEnv* env,
|
||||
jobject obj,
|
||||
jobject context) {
|
||||
OutputType::SetAndroidAudioDeviceObjects(env, obj, context);
|
||||
InputType::SetAndroidAudioDeviceObjects(env, obj, context);
|
||||
}
|
||||
|
||||
private:
|
||||
OutputType output_;
|
||||
InputType input_;
|
||||
@ -92,6 +84,10 @@ class OpenSlRunner
|
||||
jobject obj,
|
||||
jobject context) {
|
||||
assert(!g_runner); // Should only be called once.
|
||||
// Register the application context in the superclass to avoid having to
|
||||
// qualify the template instantiation again.
|
||||
OpenSlesInput::SetAndroidAudioDeviceObjects(g_vm, env, context);
|
||||
OpenSlesOutput::SetAndroidAudioDeviceObjects(g_vm, env, context);
|
||||
g_runner = new OpenSlRunner();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user