[Android] libvlc/MediaList: remove unused loadPlaylist

Thomas Guillem git at videolan.org
Wed Dec 31 18:03:49 CET 2014


vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Dec 31 14:04:40 2014 +0100| [ad4b18096170b27a0751aa69642b65e471319474] | committer: Thomas Guillem

libvlc/MediaList: remove unused loadPlaylist

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

 libvlc/jni/libvlcjni-medialist.c              |   41 -------------------------
 libvlc/src/org/videolan/libvlc/MediaList.java |   20 ------------
 2 files changed, 61 deletions(-)

diff --git a/libvlc/jni/libvlcjni-medialist.c b/libvlc/jni/libvlcjni-medialist.c
index f5a548f..a9a5e98 100644
--- a/libvlc/jni/libvlcjni-medialist.c
+++ b/libvlc/jni/libvlcjni-medialist.c
@@ -81,44 +81,3 @@ jint Java_org_videolan_libvlc_LibVLC_expandMedia(JNIEnv *env, jobject thiz, jint
         children,
         (libvlc_media_t*)libvlc_media_player_get_media(getMediaPlayer(env, thiz)));
 }
-
-void Java_org_videolan_libvlc_LibVLC_loadPlaylist(JNIEnv *env, jobject thiz, jstring mrl, jobject items) {
-    const char* p_mrl = (*env)->GetStringUTFChars(env, mrl, NULL);
-    libvlc_instance_t *p_instance = getLibVlcInstance(env, thiz);
-
-    libvlc_media_t *p_md = libvlc_media_new_location(p_instance, p_mrl);
-    libvlc_media_add_option(p_md, ":demux=playlist,none");
-    libvlc_media_add_option(p_md, ":run-time=1");
-
-    struct stopped_monitor* monitor = malloc(sizeof(struct stopped_monitor));
-    pthread_mutex_init(&monitor->doneMutex, NULL);
-    pthread_cond_init(&monitor->doneCondVar, NULL);
-    monitor->stopped = false;
-    pthread_mutex_lock(&monitor->doneMutex);
-
-    libvlc_media_player_t* p_mp = libvlc_media_player_new(p_instance);
-    libvlc_media_player_set_video_title_display(p_mp, libvlc_position_disable, 0);
-    libvlc_event_manager_t* ev = libvlc_media_player_event_manager(p_mp);
-    libvlc_event_attach(ev, libvlc_MediaPlayerEndReached, stopped_callback, monitor);
-    libvlc_media_player_set_media(p_mp, p_md);
-    libvlc_media_player_play(p_mp);
-
-    struct timespec deadline;
-    clock_gettime(CLOCK_REALTIME, &deadline);
-    deadline.tv_sec += 2; /* If "VLC can't open the file", return */
-    int mp_alive = 1;
-    while(!(monitor->stopped) && mp_alive) {
-        pthread_cond_timedwait(&monitor->doneCondVar, &monitor->doneMutex, &deadline);
-        mp_alive = libvlc_media_player_will_play(p_mp);
-    }
-    pthread_mutex_unlock(&monitor->doneMutex);
-    pthread_mutex_destroy(&monitor->doneMutex);
-    pthread_cond_destroy(&monitor->doneCondVar);
-    free(monitor);
-
-    libvlc_media_player_release(p_mp);
-
-    expand_media_internal(env, p_instance, items, p_md);
-
-    (*env)->ReleaseStringUTFChars(env, mrl, p_mrl);
-}
diff --git a/libvlc/src/org/videolan/libvlc/MediaList.java b/libvlc/src/org/videolan/libvlc/MediaList.java
index 228433e..2daec2f 100644
--- a/libvlc/src/org/videolan/libvlc/MediaList.java
+++ b/libvlc/src/org/videolan/libvlc/MediaList.java
@@ -42,17 +42,6 @@ public class MediaList {
         mLibVLC = libVLC;
     }
 
-    /**
-     * Adds a media URI to the media list.
-     *
-     * @param mrl
-     *            The MRL to add. Must be a location and not a path.
-     *            {@link LibVLC#PathToURI(String)} can be used to convert a path
-     *            to a MRL.
-     */
-    public void add(String mrl) {
-        add(new Media(mLibVLC, mrl));
-    }
     public void add(Media media) {
         mInternalList.add(media);
     }
@@ -94,15 +83,6 @@ public class MediaList {
         return ret;
     }
 
-    public void loadPlaylist(String mrl) {
-        ArrayList<String> items = new ArrayList<String>();
-        mLibVLC.loadPlaylist(mrl, items);
-        this.clear();
-        for(String item : items) {
-            this.add(item);
-        }
-    }
-
     public void insert(int position, String mrl) {
         insert(position, new Media(mLibVLC, mrl));
     }



More information about the Android mailing list