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,
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)
{
/* Create a new item */
......@@ -636,6 +636,8 @@ void Java_org_videolan_vlc_LibVLC_readMedia(JNIEnv *env, jobject thiz,
libvlc_media_release(m);
create_player_and_play(env, thiz, instance, position);
return position;
}
void Java_org_videolan_vlc_LibVLC_playIndex(JNIEnv *env, jobject thiz,
......
......@@ -247,9 +247,9 @@ public class LibVLC {
/**
* Read a media.
*/
public void readMedia(String mrl, boolean novideo) {
public int readMedia(String mrl, boolean novideo) {
Log.v(TAG, "Reading " + mrl);
readMedia(mLibVlcInstance, mrl, novideo);
return readMedia(mLibVlcInstance, mrl, novideo);
}
/**
......@@ -324,8 +324,9 @@ public class LibVLC {
* Read a media
* @param instance: the instance of libVLC
* @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)
......
Supports Markdown
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