[Android] [PATCH] directory: don't scan media on UI threads.

Thomas Guillem thomas at gllm.fr
Tue Feb 24 17:15:52 CET 2015


It breaks title fetch from directory. It'll be back when MediaBrowser is used
for local directory browsing.
---
 vlc-android/src/org/videolan/vlc/gui/DirectoryAdapter.java | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/DirectoryAdapter.java b/vlc-android/src/org/videolan/vlc/gui/DirectoryAdapter.java
index 90b11e5..30be553 100644
--- a/vlc-android/src/org/videolan/vlc/gui/DirectoryAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/DirectoryAdapter.java
@@ -29,9 +29,7 @@ import java.util.ListIterator;
 import java.util.regex.Pattern;
 
 import org.videolan.libvlc.LibVLC;
-import org.videolan.libvlc.Media;
 import org.videolan.libvlc.util.Extensions;
-import org.videolan.vlc.MediaWrapper;
 import org.videolan.vlc.R;
 import org.videolan.vlc.VLCApplication;
 import org.videolan.vlc.util.AndroidDevices;
@@ -343,16 +341,7 @@ public class DirectoryAdapter extends BaseAdapter {
             holder = (DirectoryViewHolder) v.getTag();
 
         String holderText = "";
-        if(selectedNode.isFile()) {
-            Log.d(TAG, "Loading media " + selectedNode.name);
-            final Media media = new Media(LibVLC.getExistingInstance(), getMediaLocation(position));
-            media.parse(); // FIXME: parse should'nt be done asynchronously
-            media.release();
-            MediaWrapper mw = new MediaWrapper(media);
-            holder.title.setText(mw.getTitle());
-            holderText = Util.getMediaSubtitle(context, mw);
-        } else
-            holder.title.setText(selectedNode.getVisibleName());
+        holder.title.setText(selectedNode.getVisibleName());
 
         if(selectedNode.name.equals(".."))
             holderText = context.getString(R.string.parent_folder);
-- 
2.1.3



More information about the Android mailing list