[Android] simplify callbacks
Rafaël Carré
git at videolan.org
Mon Mar 18 23:11:17 CET 2013
vlc-ports/android | branch: master | Rafaël Carré <funman at videolan.org> | Mon Mar 18 23:11:09 2013 +0100| [91ddd76c78bdfa2f4930fdb9d229d8ee23c63800] | committer: Rafaël Carré
simplify callbacks
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=91ddd76c78bdfa2f4930fdb9d229d8ee23c63800
---
vlc-android/jni/libvlcjni.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/vlc-android/jni/libvlcjni.c b/vlc-android/jni/libvlcjni.c
index 0db3c27..239314b 100644
--- a/vlc-android/jni/libvlcjni.c
+++ b/vlc-android/jni/libvlcjni.c
@@ -241,17 +241,14 @@ void jni_SetAndroidSurfaceSize(int width, int height, int sar_num, int sar_den)
static void vlc_event_callback(const libvlc_event_t *ev, void *data)
{
JNIEnv *env;
- JavaVM *myVm = data;
bool isAttached = false;
if (eventManagerInstance == NULL)
return;
- int status = (*myVm)->GetEnv(myVm, (void**) &env, JNI_VERSION_1_2);
- if (status < 0) {
- status = (*myVm)->AttachCurrentThread(myVm, &env, NULL);
- if (status < 0)
+ if ((*myVm)->GetEnv(myVm, (void**) &env, JNI_VERSION_1_2) < 0) {
+ if ((*myVm)->AttachCurrentThread(myVm, &env, NULL) < 0)
return;
isAttached = true;
}
@@ -378,10 +375,8 @@ static void debug_buffer_log(void *data, int level, const char *fmt, va_list ap)
bool isAttached = false;
JNIEnv *env = NULL;
- int status = (*myVm)->GetEnv(myVm, (void**) &env, JNI_VERSION_1_2);
- if (status < 0) {
- status = (*myVm)->AttachCurrentThread(myVm, &env, NULL);
- if (status < 0)
+ if ((*myVm)->GetEnv(myVm, (void**) &env, JNI_VERSION_1_2) < 0) {
+ if ((*myVm)->AttachCurrentThread(myVm, &env, NULL) < 0)
return;
isAttached = true;
}
More information about the Android
mailing list