[Android] Release monitor when done

Edward Wang git at videolan.org
Wed Jun 20 13:14:46 CEST 2012


android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Wed Jun 20 07:08:17 2012 -0400| [d964ff85d679519ec48cd6ae80a0f5bbd3b703b4] | committer: Edward Wang

Release monitor when done

> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=d964ff85d679519ec48cd6ae80a0f5bbd3b703b4
---

 vlc-android/jni/libvlcjni.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/vlc-android/jni/libvlcjni.c b/vlc-android/jni/libvlcjni.c
index f6979ae..8ebf843 100644
--- a/vlc-android/jni/libvlcjni.c
+++ b/vlc-android/jni/libvlcjni.c
@@ -581,10 +581,15 @@ jboolean Java_org_videolan_vlc_LibVLC_hasVideoTrack(JNIEnv *env, jobject thiz,
     int i_nbTracks = libvlc_video_get_track_count(p_mp);
     LOGI("Number of video tracks: %d",i_nbTracks);
 
+    libvlc_event_detach(ev, libvlc_MediaPlayerLengthChanged, length_changed_callback, monitor);
     libvlc_media_player_stop(p_mp);
     libvlc_media_player_release(p_mp);
     libvlc_media_release(p_m);
 
+    pthread_mutex_destroy(&monitor->doneMutex);
+    pthread_cond_destroy(&monitor->doneCondVar);
+    free(monitor);
+
     if(i_nbTracks > 0)
         return JNI_TRUE;
     else



More information about the Android mailing list