[Android] jni: there is only one media_t at once now

Edward Wang git at videolan.org
Mon Oct 28 04:14:42 CET 2013


vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Sun Oct 27 22:27:29 2013 -0400| [f98a3eddc17b5176ad3f9475adb90056dc6c9e0c] | committer: Edward Wang

jni: there is only one media_t at once now

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

 vlc-android/jni/libvlcjni-track.c               |   13 ++++++++-----
 vlc-android/src/org/videolan/libvlc/LibVLC.java |    2 +-
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/vlc-android/jni/libvlcjni-track.c b/vlc-android/jni/libvlcjni-track.c
index bc38025..b281c0f 100644
--- a/vlc-android/jni/libvlcjni-track.c
+++ b/vlc-android/jni/libvlcjni-track.c
@@ -197,13 +197,16 @@ jobjectArray Java_org_videolan_libvlc_LibVLC_readTracksInfo(JNIEnv *env, jobject
 }
 
 
-jobjectArray Java_org_videolan_libvlc_LibVLC_readTracksInfoPosition(JNIEnv *env, jobject thiz,
-                                                                    jobject mlJ, jint position)
+jobjectArray Java_org_videolan_libvlc_LibVLC_readTracksInfoInternal(JNIEnv *env, jobject thiz)
 {
-    libvlc_media_list_t* p_mlist = getMediaListFromJava(env, mlJ);
-    libvlc_media_t *p_m = libvlc_media_list_item_at_index( p_mlist, position );
+    libvlc_media_player_t* p_mp = getMediaPlayer(env, thiz);
+    if (p_mp == NULL) {
+        LOGE("No media player!");
+        return NULL;
+    }
+    libvlc_media_t *p_m = libvlc_media_player_get_media(p_mp);
     if (p_m == NULL) {
-        LOGE("Could not load get media @ position %d!", position);
+        LOGE("Could not load internal media!");
         return NULL;
     } else
         return read_track_info_internal(env, thiz, p_m);
diff --git a/vlc-android/src/org/videolan/libvlc/LibVLC.java b/vlc-android/src/org/videolan/libvlc/LibVLC.java
index 00d14d9..c558f87 100644
--- a/vlc-android/src/org/videolan/libvlc/LibVLC.java
+++ b/vlc-android/src/org/videolan/libvlc/LibVLC.java
@@ -558,7 +558,7 @@ public class LibVLC {
 
     private native TrackInfo[] readTracksInfo(long instance, String mrl);
 
-    public native TrackInfo[] readTracksInfoPosition(MediaList mediaList, int position);
+    public native TrackInfo[] readTracksInfoInternal();
 
     public native int getAudioTracksCount();
 



More information about the Android mailing list