Commit f6ee16ae authored by Philippe Morin's avatar Philippe Morin

Add libvlc_media_instance_release(input) call to correctly release

the media instance.
parent 179c1855
......@@ -41,7 +41,8 @@ JNIEXPORT jint JNICALL Java_org_videolan_jvlc_Audio__1getTrack (JNIEnv *env, job
jint res = 0;
res = libvlc_audio_get_track( input, exception );
libvlc_media_instance_release(input);
CHECK_EXCEPTION_FREE;
return res;
......@@ -54,6 +55,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Audio__1setTrack (JNIEnv *env, job
libvlc_audio_set_track( input, value, exception );
libvlc_media_instance_release(input);
CHECK_EXCEPTION_FREE;
}
......
......@@ -39,6 +39,8 @@ JNIEXPORT jlong JNICALL Java_org_videolan_jvlc_Input__1getLength (JNIEnv *env, j
GET_INPUT_THREAD ;
res = libvlc_media_instance_get_length( input, exception );
libvlc_media_instance_release(input);
CHECK_EXCEPTION_FREE;
return res;
......@@ -52,6 +54,7 @@ JNIEXPORT jfloat JNICALL Java_org_videolan_jvlc_Input__1getPosition (JNIEnv *env
GET_INPUT_THREAD ;
res = libvlc_media_instance_get_position( input, exception );
libvlc_media_instance_release(input);
CHECK_EXCEPTION_FREE;
return res;
......@@ -65,6 +68,7 @@ JNIEXPORT jlong JNICALL Java_org_videolan_jvlc_Input__1getTime (JNIEnv *env, job
GET_INPUT_THREAD ;
res = libvlc_media_instance_get_time( input, exception );
libvlc_media_instance_release(input);
CHECK_EXCEPTION_FREE ;
return res;
......@@ -78,6 +82,7 @@ JNIEXPORT jfloat JNICALL Java_org_videolan_jvlc_Input__1getFPS (JNIEnv *env, job
GET_INPUT_THREAD ;
res = libvlc_media_instance_get_fps( input, exception );
libvlc_media_instance_release(input);
CHECK_EXCEPTION_FREE ;
return res;
......@@ -90,6 +95,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Input__1setTime (JNIEnv *env, jobj
GET_INPUT_THREAD ;
libvlc_media_instance_set_time( input, time, exception );
libvlc_media_instance_release(input);
CHECK_EXCEPTION_FREE;
}
......@@ -101,6 +107,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Input__1setPosition (JNIEnv *env,
GET_INPUT_THREAD ;
libvlc_media_instance_set_position( input, position, exception );
libvlc_media_instance_release(input);
CHECK_EXCEPTION_FREE;
}
......@@ -112,6 +119,7 @@ JNIEXPORT jboolean JNICALL Java_org_videolan_jvlc_Input__1isPlaying (JNIEnv *env
GET_INPUT_THREAD ;
res = libvlc_media_instance_will_play( input, exception );
libvlc_media_instance_release(input);
CHECK_EXCEPTION_FREE ;
return res;
......@@ -125,6 +133,7 @@ JNIEXPORT jboolean JNICALL Java_org_videolan_jvlc_Input__1hasVout (JNIEnv *env,
GET_INPUT_THREAD ;
res = libvlc_media_instance_has_vout( input, exception );
libvlc_media_instance_release(input);
CHECK_EXCEPTION_FREE ;
return res;
......
......@@ -42,6 +42,8 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1toggleFullscreen (JNIEnv *
libvlc_toggle_fullscreen( input, exception );
libvlc_media_instance_release(input);
CHECK_EXCEPTION_FREE ;
}
......@@ -53,6 +55,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1setFullscreen (JNIEnv *env
libvlc_set_fullscreen( input, value, exception );
libvlc_media_instance_release(input);
CHECK_EXCEPTION_FREE ;
}
......@@ -65,6 +68,7 @@ JNIEXPORT jboolean JNICALL Java_org_videolan_jvlc_Video__1getFullscreen (JNIEnv
res = libvlc_get_fullscreen( input, exception );
libvlc_media_instance_release(input);
CHECK_EXCEPTION_FREE ;
return res;
......@@ -79,6 +83,7 @@ JNIEXPORT jint JNICALL Java_org_videolan_jvlc_Video__1getHeight (JNIEnv *env, jo
res = libvlc_video_get_height( input, exception );
libvlc_media_instance_release(input);
CHECK_EXCEPTION_FREE ;
return res;
......@@ -93,6 +98,7 @@ JNIEXPORT jint JNICALL Java_org_videolan_jvlc_Video__1getWidth (JNIEnv *env, job
res = libvlc_video_get_width( input, exception );
libvlc_media_instance_release(input);
CHECK_EXCEPTION_FREE ;
return res;
......@@ -108,6 +114,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1getSnapshot (JNIEnv *env,
libvlc_video_take_snapshot( input, (char *) psz_filepath, exception );
libvlc_media_instance_release(input);
CHECK_EXCEPTION_FREE ;
if (psz_filepath != NULL) {
......@@ -124,6 +131,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1destroyVideo (JNIEnv *env,
libvlc_video_destroy( input, exception );
libvlc_media_instance_release(input);
CHECK_EXCEPTION_FREE;
}
......@@ -150,6 +158,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1reparent (JNIEnv *env, job
awt.version = JAWT_VERSION_1_3;
if (JAWT_GetAWT(env, &awt) == JNI_FALSE) {
printf("AWT Not found\n");
libvlc_media_instance_release(input);
return;
}
......@@ -157,6 +166,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1reparent (JNIEnv *env, job
ds = awt.GetDrawingSurface(env, canvas);
if (ds == NULL) {
printf("NULL drawing surface\n");
libvlc_media_instance_release(input);
return;
}
......@@ -165,6 +175,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1reparent (JNIEnv *env, job
if((lock & JAWT_LOCK_ERROR) != 0) {
printf("Error locking surface\n");
awt.FreeDrawingSurface(ds);
libvlc_media_instance_release(input);
return;
}
......@@ -174,6 +185,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1reparent (JNIEnv *env, job
printf("Error getting surface info\n");
ds->Unlock(ds);
awt.FreeDrawingSurface(ds);
libvlc_media_instance_release(input);
return;
}
......@@ -184,6 +196,7 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1reparent (JNIEnv *env, job
drawable = reinterpret_cast<int>(dsi_win->hwnd);
libvlc_video_set_parent((libvlc_instance_t *) instance, drawable, exception );
libvlc_media_instance_release(input);
CHECK_EXCEPTION_FREE ;
......@@ -311,5 +324,6 @@ JNIEXPORT void JNICALL Java_org_videolan_jvlc_Video__1setSize (JNIEnv *env, jobj
libvlc_video_resize( input, width, height, exception );
libvlc_media_instance_release(input);
CHECK_EXCEPTION_FREE ;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment