diff options
Diffstat (limited to 'firmware/target/hosted/android/pcm-android.c')
-rw-r--r-- | firmware/target/hosted/android/pcm-android.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/firmware/target/hosted/android/pcm-android.c b/firmware/target/hosted/android/pcm-android.c index edb3503262..cc8bd9c48a 100644 --- a/firmware/target/hosted/android/pcm-android.c +++ b/firmware/target/hosted/android/pcm-android.c | |||
@@ -36,6 +36,7 @@ static char *pcm_data_start; | |||
36 | static jmethodID play_pause_method; | 36 | static jmethodID play_pause_method; |
37 | static jmethodID stop_method; | 37 | static jmethodID stop_method; |
38 | static jmethodID set_volume_method; | 38 | static jmethodID set_volume_method; |
39 | static jclass RockboxPCM_class; | ||
39 | static jobject RockboxPCM_instance; | 40 | static jobject RockboxPCM_instance; |
40 | 41 | ||
41 | 42 | ||
@@ -159,7 +160,7 @@ void pcm_play_dma_init(void) | |||
159 | **/ | 160 | **/ |
160 | JNIEnv e = *env_ptr; | 161 | JNIEnv e = *env_ptr; |
161 | /* get the class and its constructor */ | 162 | /* get the class and its constructor */ |
162 | jclass RockboxPCM_class = e->FindClass(env_ptr, "org/rockbox/RockboxPCM"); | 163 | RockboxPCM_class = e->FindClass(env_ptr, "org/rockbox/RockboxPCM"); |
163 | jmethodID constructor = e->GetMethodID(env_ptr, RockboxPCM_class, "<init>", "()V"); | 164 | jmethodID constructor = e->GetMethodID(env_ptr, RockboxPCM_class, "<init>", "()V"); |
164 | /* instance = new RockboxPCM() */ | 165 | /* instance = new RockboxPCM() */ |
165 | RockboxPCM_instance = e->NewObject(env_ptr, RockboxPCM_class, constructor); | 166 | RockboxPCM_instance = e->NewObject(env_ptr, RockboxPCM_class, constructor); |
@@ -180,6 +181,15 @@ void pcm_set_mixer_volume(int volume) | |||
180 | (*env_ptr)->CallVoidMethod(env_ptr, RockboxPCM_instance, set_volume_method, volume); | 181 | (*env_ptr)->CallVoidMethod(env_ptr, RockboxPCM_instance, set_volume_method, volume); |
181 | } | 182 | } |
182 | 183 | ||
184 | /* | ||
185 | * release audio resources */ | ||
186 | void pcm_shutdown(void) | ||
187 | { | ||
188 | JNIEnv e = *env_ptr; | ||
189 | jmethodID release = e->GetMethodID(env_ptr, RockboxPCM_class, "release", "()V"); | ||
190 | e->CallVoidMethod(env_ptr, RockboxPCM_instance, release); | ||
191 | } | ||
192 | |||
183 | /* Due to limitations of default_event_handler(), parameters gets swallowed when | 193 | /* Due to limitations of default_event_handler(), parameters gets swallowed when |
184 | * being posted with queue_broadcast(), so workaround this by caching the last | 194 | * being posted with queue_broadcast(), so workaround this by caching the last |
185 | * value. | 195 | * value. |