Commit fc205152 authored by Ludovic Fauvet's avatar Ludovic Fauvet
Browse files

libvlcjni: return the index in the playlist from readMedia

parent f218ef79
...@@ -609,7 +609,7 @@ static void create_player_and_play(JNIEnv* env, jobject thiz, ...@@ -609,7 +609,7 @@ static void create_player_and_play(JNIEnv* env, jobject thiz,
libvlc_media_list_player_play_item_at_index(p_mlp, position); libvlc_media_list_player_play_item_at_index(p_mlp, position);
} }
void Java_org_videolan_vlc_LibVLC_readMedia(JNIEnv *env, jobject thiz, jint Java_org_videolan_vlc_LibVLC_readMedia(JNIEnv *env, jobject thiz,
jlong instance, jstring mrl, jboolean novideo) jlong instance, jstring mrl, jboolean novideo)
{ {
/* Create a new item */ /* Create a new item */
...@@ -636,6 +636,8 @@ void Java_org_videolan_vlc_LibVLC_readMedia(JNIEnv *env, jobject thiz, ...@@ -636,6 +636,8 @@ void Java_org_videolan_vlc_LibVLC_readMedia(JNIEnv *env, jobject thiz,
libvlc_media_release(m); libvlc_media_release(m);
create_player_and_play(env, thiz, instance, position); create_player_and_play(env, thiz, instance, position);
return position;
} }
void Java_org_videolan_vlc_LibVLC_playIndex(JNIEnv *env, jobject thiz, void Java_org_videolan_vlc_LibVLC_playIndex(JNIEnv *env, jobject thiz,
......
...@@ -247,9 +247,9 @@ public class LibVLC { ...@@ -247,9 +247,9 @@ public class LibVLC {
/** /**
* Read a media. * Read a media.
*/ */
public void readMedia(String mrl, boolean novideo) { public int readMedia(String mrl, boolean novideo) {
Log.v(TAG, "Reading " + mrl); Log.v(TAG, "Reading " + mrl);
readMedia(mLibVlcInstance, mrl, novideo); return readMedia(mLibVlcInstance, mrl, novideo);
} }
/** /**
...@@ -324,8 +324,9 @@ public class LibVLC { ...@@ -324,8 +324,9 @@ public class LibVLC {
* Read a media * Read a media
* @param instance: the instance of libVLC * @param instance: the instance of libVLC
* @param mrl: the media mrl * @param mrl: the media mrl
* @return the position in the playlist
*/ */
private native void readMedia(long instance, String mrl, boolean novideo); private native int readMedia(long instance, String mrl, boolean novideo);
/** /**
* Play an index in the native media list (playlist) * Play an index in the native media list (playlist)
......
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