[Android] Remove filter for duplicate servers
Geoffrey Métais
git at videolan.org
Thu Sep 15 15:54:39 CEST 2016
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Sep 15 15:54:15 2016 +0200| [d9ad18970f5daa7269e2258412a1250ba1384c56] | committer: Geoffrey Métais
Remove filter for duplicate servers
> https://code.videolan.org/videolan/vlc-android/commit/d9ad18970f5daa7269e2258412a1250ba1384c56
---
libvlc/src/org/videolan/libvlc/util/MediaBrowser.java | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)
diff --git a/libvlc/src/org/videolan/libvlc/util/MediaBrowser.java b/libvlc/src/org/videolan/libvlc/util/MediaBrowser.java
index 1ca2c11..59dbb7a 100644
--- a/libvlc/src/org/videolan/libvlc/util/MediaBrowser.java
+++ b/libvlc/src/org/videolan/libvlc/util/MediaBrowser.java
@@ -24,13 +24,13 @@ import android.net.Uri;
import android.support.annotation.MainThread;
import android.util.Log;
-import java.util.ArrayList;
-
import org.videolan.libvlc.LibVLC;
import org.videolan.libvlc.Media;
import org.videolan.libvlc.MediaDiscoverer;
import org.videolan.libvlc.MediaList;
+import java.util.ArrayList;
+
public class MediaBrowser {
private static final String TAG = "MediaBrowser";
@@ -273,19 +273,8 @@ public class MediaBrowser {
*/
switch (mlEvent.type) {
case MediaList.Event.ItemAdded:
- /* one item can be found by severals discoverers */
- boolean found = false;
- for (Media media : mDiscovererMediaArray) {
- if (media.getUri().toString().equalsIgnoreCase(mlEvent.media.getUri().toString())) {
- found = true;
- break;
- }
- }
- if (!found) {
- mDiscovererMediaArray.add(mlEvent.media);
- index = mDiscovererMediaArray.size() - 1;
- }if (index != -1)
- mEventListener.onMediaAdded(index, mlEvent.media);
+ mDiscovererMediaArray.add(mlEvent.media);
+ mEventListener.onMediaAdded(index, mlEvent.media);
break;
case MediaList.Event.ItemDeleted:
index = mDiscovererMediaArray.indexOf(mlEvent.media);
More information about the Android
mailing list