[Android] Media: remove dependency on the default list

Edward Wang git at videolan.org
Sun Sep 1 15:47:05 CEST 2013


vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Sun Sep  1 15:46:49 2013 +0200| [0c82fd050efba89c0014871f17ff97460c09e257] | committer: Edward Wang

Media: remove dependency on the default list

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

 vlc-android/src/org/videolan/vlc/Media.java              |    5 +++--
 vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java |    2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/Media.java b/vlc-android/src/org/videolan/vlc/Media.java
index 1cc3136..81d95a8 100644
--- a/vlc-android/src/org/videolan/vlc/Media.java
+++ b/vlc-android/src/org/videolan/vlc/Media.java
@@ -25,6 +25,7 @@ import java.util.Locale;
 
 import org.videolan.libvlc.LibVLC;
 import org.videolan.libvlc.LibVlcException;
+import org.videolan.libvlc.MediaList;
 import org.videolan.libvlc.TrackInfo;
 
 import android.content.Context;
@@ -155,7 +156,7 @@ public class Media implements Comparable<Media> {
         }
     }
 
-    public Media(String URI, int position) {
+    public Media(String URI, MediaList list, int position) {
         mLocation = URI;
 
         LibVLC mLibVlc = null;
@@ -163,7 +164,7 @@ public class Media implements Comparable<Media> {
             mLibVlc = Util.getLibVlcInstance();
             mType = TYPE_ALL;
 
-            TrackInfo[] tracks = mLibVlc.readTracksInfoPosition(mLibVlc.getPrimaryMediaList(), position);
+            TrackInfo[] tracks = mLibVlc.readTracksInfoPosition(list, position);
 
             extractTrackInfo(tracks);
         } catch (LibVlcException e) {
diff --git a/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java b/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java
index 372582e..813ea1b 100644
--- a/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java
@@ -94,7 +94,7 @@ public class HistoryAdapter extends BaseAdapter {
 
         String holderText = "";
         Log.d(TAG, "Loading media position " + position + " - " + selected);
-        Media m = new Media(selected, position);
+        Media m = new Media(selected, LibVLC.getExistingInstance().getPrimaryMediaList(), position);
         holder.title.setText(m.getTitle());
         holderText = m.getSubtitle();
 



More information about the Android mailing list