summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/android/pcm-android.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/hosted/android/pcm-android.c')
-rw-r--r--firmware/target/hosted/android/pcm-android.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/firmware/target/hosted/android/pcm-android.c b/firmware/target/hosted/android/pcm-android.c
index 4b6df7f878..0f59f3f2ab 100644
--- a/firmware/target/hosted/android/pcm-android.c
+++ b/firmware/target/hosted/android/pcm-android.c
@@ -33,6 +33,7 @@ static char *pcm_data_start;
33static jmethodID play_pause_method; 33static jmethodID play_pause_method;
34static jmethodID stop_method; 34static jmethodID stop_method;
35static jmethodID set_volume_method; 35static jmethodID set_volume_method;
36static jclass RockboxPCM_class;
36static jobject RockboxPCM_instance; 37static jobject RockboxPCM_instance;
37 38
38 39
@@ -157,11 +158,10 @@ void pcm_play_dma_init(void)
157 JNIEnv *env_ptr = getJavaEnvironment(); 158 JNIEnv *env_ptr = getJavaEnvironment();
158 JNIEnv e = *env_ptr; 159 JNIEnv e = *env_ptr;
159 /* get the class and its constructor */ 160 /* get the class and its constructor */
160 jclass RockboxPCM_class = e->FindClass(env_ptr, "org/rockbox/RockboxPCM"); 161 RockboxPCM_class = e->FindClass(env_ptr, "org/rockbox/RockboxPCM");
161 jmethodID constructor = e->GetMethodID(env_ptr, RockboxPCM_class, "<init>", "()V"); 162 jmethodID constructor = e->GetMethodID(env_ptr, RockboxPCM_class, "<init>", "()V");
162 /* instance = new RockboxPCM() */ 163 /* instance = new RockboxPCM() */
163 jobject PCM_instance = e->NewObject(env_ptr, RockboxPCM_class, constructor); 164 RockboxPCM_instance = e->NewObject(env_ptr, RockboxPCM_class, constructor);
164 RockboxPCM_instance = e->NewGlobalRef(env_ptr, PCM_instance);
165 /* cache needed methods */ 165 /* cache needed methods */
166 play_pause_method = e->GetMethodID(env_ptr, RockboxPCM_class, "play_pause", "(Z)V"); 166 play_pause_method = e->GetMethodID(env_ptr, RockboxPCM_class, "play_pause", "(Z)V");
167 set_volume_method = e->GetMethodID(env_ptr, RockboxPCM_class, "set_volume", "(I)V"); 167 set_volume_method = e->GetMethodID(env_ptr, RockboxPCM_class, "set_volume", "(I)V");
@@ -170,13 +170,6 @@ void pcm_play_dma_init(void)
170 pcm_play_get_more_callback((void*)&pcm_data_start, &pcm_data_size); 170 pcm_play_get_more_callback((void*)&pcm_data_start, &pcm_data_size);
171} 171}
172 172
173void pcm_deinit(void)
174{
175 JNIEnv *env_ptr = getJavaEnvironment();
176
177 (*env_ptr)->DeleteGlobalRef(env_ptr, RockboxPCM_instance);
178}
179
180void pcm_postinit(void) 173void pcm_postinit(void)
181{ 174{
182} 175}