[Android] Restrict filtering to .mod files

Geoffrey Métais git at videolan.org
Thu Mar 26 17:10:16 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Mar 26 16:57:58 2015 +0100| [cf27902ee96d402063021c83e59f9a5f116dacfd] | committer: Geoffrey Métais

Restrict filtering to .mod files

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

 vlc-android/src/org/videolan/vlc/MediaLibrary.java |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/MediaLibrary.java b/vlc-android/src/org/videolan/vlc/MediaLibrary.java
index fd2d752..a6e959c 100644
--- a/vlc-android/src/org/videolan/vlc/MediaLibrary.java
+++ b/vlc-android/src/org/videolan/vlc/MediaLibrary.java
@@ -48,6 +48,7 @@ import android.content.Context;
 import android.os.Environment;
 import android.os.Handler;
 import android.os.Message;
+import android.text.TextUtils;
 import android.util.Log;
 
 public class MediaLibrary {
@@ -366,9 +367,9 @@ public class MediaLibrary {
                         final Media media = new Media(libVlcInstance, fileURI);
                         media.parse();
                         media.release();
-                        /* skip files with audio/video extension but no known codec */
-                        if (media.getDuration() == 0 ||
-                                (media.getTrackCount() == 1 && media.getTrack(0).codec.isEmpty())) {
+                        /* skip files with .mod extension and no duration */
+                        if ((media.getDuration() == 0 || (media.getTrackCount() != 0 && TextUtils.isEmpty(media.getTrack(0).codec))) &&
+                            fileURI.endsWith(".mod")) {
                             mItemListLock.writeLock().unlock();
                             continue;
                         }



More information about the Android mailing list