From 0cc2e86492b4474c8b45f570d6deb7a0db4bffc7 Mon Sep 17 00:00:00 2001 From: Youness Alaoui Date: Thu, 15 Nov 2012 12:33:26 -0500 Subject: [PATCH] androicamera: Make sure the TMP env var exists and check for DEX var too --- sys/androidcamera/gst-android-hardware-camera.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/androidcamera/gst-android-hardware-camera.c b/sys/androidcamera/gst-android-hardware-camera.c index b8f6a854e5..8e104e79e0 100644 --- a/sys/androidcamera/gst-android-hardware-camera.c +++ b/sys/androidcamera/gst-android-hardware-camera.c @@ -1065,7 +1065,7 @@ _init_classes (void) GST_DVM_GET_METHOD (java_lang_integer, intValue, "()I"); /* com.gstreamer.GstAhcCallback */ - if (gst_ahc_callback_jar) { + if (gst_ahc_callback_jar && g_getenv ("TMP")) { jclass dex_loader = NULL; gchar *path = g_strdup_printf ("%s/GstAhcCallback.jar", g_getenv ("TMP")); FILE *fd = fopen (path, "wb"); @@ -1095,7 +1095,10 @@ _init_classes (void) jstring optimized_directory = NULL; dex_path = (*env)->NewStringUTF (env, path); - optimized_directory = (*env)->NewStringUTF (env, g_getenv ("TMP")); + if (g_getenv ("DEX")) + optimized_directory = (*env)->NewStringUTF (env, g_getenv ("DEX")); + else + optimized_directory = (*env)->NewStringUTF (env, g_getenv ("TMP")); (*env)->ExceptionClear (env); if (dex_path && optimized_directory) { jobject loader;