[Android] libvlc: remove unused mPrimaryList

Thomas Guillem git at videolan.org
Wed Dec 31 18:03:48 CET 2014


vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Dec 31 11:29:44 2014 +0100| [f81819ffc18680367306707f982739f4daaedd67] | committer: Thomas Guillem

libvlc: remove unused mPrimaryList

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

 libvlc/src/org/videolan/libvlc/LibVLC.java         |   37 +-------------------
 .../src/org/videolan/vlc/audio/AudioService.java   |    3 +-
 .../src/org/videolan/vlc/gui/HistoryAdapter.java   |    8 ++---
 .../src/org/videolan/vlc/gui/HistoryFragment.java  |    3 +-
 .../vlc/gui/video/VideoPlayerActivity.java         |    2 --
 5 files changed, 7 insertions(+), 46 deletions(-)

diff --git a/libvlc/src/org/videolan/libvlc/LibVLC.java b/libvlc/src/org/videolan/libvlc/LibVLC.java
index 8bac400..237a252 100644
--- a/libvlc/src/org/videolan/libvlc/LibVLC.java
+++ b/libvlc/src/org/videolan/libvlc/LibVLC.java
@@ -68,7 +68,6 @@ public class LibVLC {
     private long mInternalMediaPlayerInstance = 0; // Read-only, reserved for JNI
 
     private MediaList mMediaList; // Pointer to media list being followed
-    private MediaList mPrimaryList; // Primary/default media list; see getPrimaryMediaList()
 
     /** Buffer for VLC messages */
     private StringBuffer mDebugLogBuffer;
@@ -222,40 +221,6 @@ public class LibVLC {
     }
 
     /**
-     * Set the media list for LibVLC to follow.
-     *
-     * @param mediaList The media list object to follow
-     */
-    public void setMediaList(MediaList mediaList) {
-        mMediaList = mediaList;
-    }
-
-    /**
-     * Sets LibVLC to follow the default media list (see below)
-     */
-    public void setMediaList() {
-        mMediaList = mPrimaryList;
-    }
-
-    /**
-     * Gets the primary media list, or the "currently playing" list.
-     * Not to be confused with the media list pointer from above, which
-     * refers the the MediaList object that libVLC is currently following.
-     * This list is just one out of many lists that it can be pointed towards.
-     *
-     * This list will be used for lists of songs that are not user-defined.
-     * For example: selecting a song from the Songs list, or from the list
-     * displayed after selecting an album.
-     *
-     * It is loaded as the default list.
-     *
-     * @return The primary media list
-     */
-    public MediaList getPrimaryMediaList() {
-        return mPrimaryList;
-    }
-
-    /**
      * Give to LibVLC the surface to draw the video.
      * @param f the surface to draw
      */
@@ -539,7 +504,7 @@ public class LibVLC {
             File cacheDir = context.getCacheDir();
             mCachePath = (cacheDir != null) ? cacheDir.getAbsolutePath() : null;
             nativeInit();
-            mMediaList = mPrimaryList = new MediaList(this);
+            mMediaList = new MediaList(this);
             setEventHandler(EventHandler.getInstance());
             mIsInitialized = true;
         }
diff --git a/vlc-android/src/org/videolan/vlc/audio/AudioService.java b/vlc-android/src/org/videolan/vlc/audio/AudioService.java
index f0a35d5..9063780 100644
--- a/vlc-android/src/org/videolan/vlc/audio/AudioService.java
+++ b/vlc-android/src/org/videolan/vlc/audio/AudioService.java
@@ -1183,8 +1183,7 @@ public class AudioService extends Service {
             mEventHandler.addHandler(mVlcEventHandler);
 
             mLibVLC.getMediaList().getEventHandler().removeHandler(mListEventHandler);
-            mLibVLC.setMediaList();
-            mLibVLC.getPrimaryMediaList().clear();
+            mLibVLC.getMediaList().clear();
             MediaList mediaList = mLibVLC.getMediaList();
 
             mPrevious.clear();
diff --git a/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java b/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java
index 806465c..29a9cd9 100644
--- a/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java
@@ -56,18 +56,18 @@ public class HistoryAdapter extends BaseAdapter {
             return;
         }
 
-        EventHandler em = mLibVLC.getPrimaryMediaList().getEventHandler();
+        EventHandler em = mLibVLC.getMediaList().getEventHandler();
         em.addHandler(new HistoryEventHandler(this));
     }
 
     @Override
     public int getCount() {
-        return mLibVLC.getPrimaryMediaList().size();
+        return mLibVLC.getMediaList().size();
     }
 
     @Override
     public Object getItem(int arg0) {
-        return mLibVLC.getPrimaryMediaList().getMRL(arg0);
+        return mLibVLC.getMediaList().getMRL(arg0);
     }
 
     @Override
@@ -94,7 +94,7 @@ public class HistoryAdapter extends BaseAdapter {
             holder = (DirectoryAdapter.DirectoryViewHolder) v.getTag();
 
         String holderText = "";
-        Media m = mLibVLC.getPrimaryMediaList().getMedia(position);
+        Media m = mLibVLC.getMediaList().getMedia(position);
         if (m == null )
             return v;
 
diff --git a/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java b/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
index 7acc53b..3ce3681 100644
--- a/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
@@ -115,7 +115,6 @@ public class HistoryFragment extends ListFragment implements IBrowser, IRefresha
     private void playListIndex(int position) {
         AudioServiceController audioController = AudioServiceController.getInstance();
 
-        LibVLC.getExistingInstance().setMediaList();
         audioController.playIndex(position);
     }
 
@@ -132,7 +131,7 @@ public class HistoryFragment extends ListFragment implements IBrowser, IRefresha
             playListIndex(info.position);
             return true;
         } else if(id == R.id.history_view_delete) {
-            LibVLC.getExistingInstance().getPrimaryMediaList().remove(info.position);
+            LibVLC.getExistingInstance().getMediaList().remove(info.position);
             mHistoryAdapter.refresh();
             return true;
         }
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index bfcb3b6..8e0c91a 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -2331,11 +2331,9 @@ public class VideoPlayerActivity extends ActionBarActivity implements IVideoPlay
             updateNavStatus();
         } else if (savedIndexPosition > -1) {
             AudioServiceController.getInstance().stop(); // Stop the previous playback.
-            mLibVLC.setMediaList();
             mLibVLC.playIndex(savedIndexPosition);
         } else if (mLocation != null && mLocation.length() > 0 && !dontParse) {
             AudioServiceController.getInstance().stop(); // Stop the previous playback.
-            mLibVLC.setMediaList();
             mLibVLC.getMediaList().add(new Media(mLibVLC, mLocation));
             savedIndexPosition = mLibVLC.getMediaList().size() - 1;
             mLibVLC.playIndex(savedIndexPosition);



More information about the Android mailing list