Avoid mallocing/freeing a libvlc_exception_t (end).
int argc;
const char **argv;
- libvlc_exception_t *exception = ( libvlc_exception_t * ) malloc( sizeof( libvlc_exception_t ) );
+ libvlc_exception_t exception;
- libvlc_exception_init( exception );
+ libvlc_exception_init( &exception );
argc = (int) env->GetArrayLength((jarray) args);
argv = (const char **) malloc(argc * sizeof(char*));
);
}
- res = (long) libvlc_new(argc, (char**) argv, exception );
-
- free( exception );
+ res = (long) libvlc_new(argc, (char**) argv, &exception );
+
+ CHECK_EXCEPTION ;
return res;
*****************************************************************************/
#include <jni.h>
-
#include <vlc/libvlc.h>
-
/* JVLC internal imports, generated by gcjh */
#include "../includes/Input.h"
#include "utils.h"
vlc_bool_t res = 0;
GET_INPUT_THREAD ;
-
+
+ if (input == NULL) {
+ return false;
+ }
+
res = libvlc_media_instance_will_play( input, &exception );
libvlc_media_instance_release(input);
CHECK_EXCEPTION ;
GET_INPUT_THREAD ;
+ if (input == NULL) {
+ return false;
+ }
res = libvlc_media_instance_has_vout( input, &exception );
libvlc_media_instance_release(input);
CHECK_EXCEPTION ;