playback/player: android: check return values from JNI methods in 'JNI_OnLoad'
This commit is contained in:
parent
c3928830cf
commit
261081aade
@ -474,8 +474,17 @@ JNI_OnLoad (JavaVM * vm, void *reserved)
|
||||
return 0;
|
||||
}
|
||||
jclass klass = (*env)->FindClass (env, "org/freedesktop/gstreamer/Player");
|
||||
(*env)->RegisterNatives (env, klass, native_methods,
|
||||
G_N_ELEMENTS (native_methods));
|
||||
if (!klass) {
|
||||
__android_log_print (ANDROID_LOG_ERROR, "GstPlayer",
|
||||
"Could not retrieve class org.freedesktop.gstreamer.Player");
|
||||
return 0;
|
||||
}
|
||||
if ((*env)->RegisterNatives (env, klass, native_methods,
|
||||
G_N_ELEMENTS (native_methods))) {
|
||||
__android_log_print (ANDROID_LOG_ERROR, "GstPlayer",
|
||||
"Could not register native methods for org.freedesktop.gstreamer.Player");
|
||||
return 0;
|
||||
}
|
||||
|
||||
pthread_key_create (¤t_jni_env, detach_current_thread);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user