[Android] Do not duplicate callbacks
Geoffrey Métais
git at videolan.org
Fri Feb 17 15:34:41 CET 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Feb 17 15:33:22 2017 +0100| [63ac7b2b2d37d62de49dac58475cebc06ef7cb48] | committer: Geoffrey Métais
Do not duplicate callbacks
> https://code.videolan.org/videolan/vlc-android/commit/63ac7b2b2d37d62de49dac58475cebc06ef7cb48
---
medialibrary/src/org/videolan/medialibrary/Medialibrary.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/medialibrary/src/org/videolan/medialibrary/Medialibrary.java b/medialibrary/src/org/videolan/medialibrary/Medialibrary.java
index ccb1ad8..7e5deec 100644
--- a/medialibrary/src/org/videolan/medialibrary/Medialibrary.java
+++ b/medialibrary/src/org/videolan/medialibrary/Medialibrary.java
@@ -437,7 +437,8 @@ public class Medialibrary {
public void addDeviceDiscoveryCb(DevicesDiscoveryCb cb) {
synchronized (devicesDiscoveryCbList) {
- devicesDiscoveryCbList.add(cb);
+ if (!devicesDiscoveryCbList.contains(cb))
+ devicesDiscoveryCbList.add(cb);
}
}
@@ -449,7 +450,8 @@ public class Medialibrary {
public void addEntryPointsEventsCb(EntryPointsEventsCb cb) {
synchronized (entryPointsEventsCbList) {
- entryPointsEventsCbList.add(cb);
+ if (!entryPointsEventsCbList.contains(cb))
+ entryPointsEventsCbList.add(cb);
}
}
More information about the Android
mailing list