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

Thomas Guillem git at videolan.org
Tue Feb 24 17:57:35 CET 2015


vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Feb 24 17:13:55 2015 +0100| [b920f5ca1065f5fc96f70b60d26fe909462e89f1] | committer: Thomas Guillem

directory: don't scan media on UI threads.

It breaks title fetch from directory. It'll be back when MediaBrowser is used
for local directory browsing.

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

 .../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);



More information about the Android mailing list