helper define added
authorFilippo Carone <littlejohn@videolan.org>
Sat, 30 Jun 2007 15:19:07 +0000 (15:19 +0000)
committerFilippo Carone <littlejohn@videolan.org>
Sat, 30 Jun 2007 15:19:07 +0000 (15:19 +0000)
src/callback-jni.cc
src/utils.h

index 1a13f9e..c8e7324 100644 (file)
@@ -66,8 +66,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Audio__1install_1callback( JNIEnv
 
 void volumeChangedCallback( struct libvlc_instance_t *p_instance, libvlc_event_t *event, void *user_data )
 {
-    JNIEnv *env;
-    jvm->AttachCurrentThread( ( void ** ) &env, NULL );
+    ATTACH_JVM;
 
     env->CallStaticVoidMethod( audioClass, wakeupListenersMethod);
 }
index cdce356..d34e5f2 100644 (file)
@@ -33,3 +33,8 @@ jlong getInstance ( JNIEnv* , jobject );
     libvlc_media_instance_t *input; \
     input = libvlc_playlist_get_media_instance( ( libvlc_instance_t *) instance, exception ); \
     CHECK_EXCEPTION ;
+
+#define ATTACH_JVM
+    JNIEnv *env; \
+    jvm->AttachCurrentThread( ( void ** ) &env, NULL );
+