ahc: Fail gracefully if our callback class can't be found

Instead of just ignoring that error and then calling JNI functions with NULL,
which will kill the virtual machine.

The error handling here needs some further improvements though, errors in more
places are just ignored.
This commit is contained in:
Sebastian Dröge 2016-01-22 17:25:28 +02:00
parent 551b0a5f28
commit c9d9042aff

View file

@ -1663,6 +1663,9 @@ _init_classes (void)
gst_amc_jni_get_class (env, &err, gst_amc_jni_get_class (env, &err,
"org/freedesktop/gstreamer/androidmedia/GstAhcCallback"); "org/freedesktop/gstreamer/androidmedia/GstAhcCallback");
} }
if (!org_freedesktop_gstreamer_androidmedia_gstahccallback.klass)
goto failed;
org_freedesktop_gstreamer_androidmedia_gstahccallback.constructor = org_freedesktop_gstreamer_androidmedia_gstahccallback.constructor =
gst_amc_jni_get_method_id (env, &err, gst_amc_jni_get_method_id (env, &err,
org_freedesktop_gstreamer_androidmedia_gstahccallback.klass, "<init>", org_freedesktop_gstreamer_androidmedia_gstahccallback.klass, "<init>",