Commit ad4b1809 authored by Thomas Guillem's avatar Thomas Guillem
Browse files

libvlc/MediaList: remove unused loadPlaylist

parent e43bc122
......@@ -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);
}
......@@ -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));
}
......
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