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
diff --git a/webrtc/modules/audio_device/android/test/jni/opensl_runner.cc b/webrtc/modules/audio_device/android/test/jni/opensl_runner.cc
index cd1b19c..9d01330 100644
--- a/webrtc/modules/audio_device/android/test/jni/opensl_runner.cc
+++ b/webrtc/modules/audio_device/android/test/jni/opensl_runner.cc
@@ -63,14 +63,6 @@
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 @@
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();
}