[Android] Unregister callback on playlist append

Geoffrey Métais git at videolan.org
Wed Oct 24 11:07:34 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Oct 23 15:55:15 2018 +0200| [78ffb088bb5eb676fe4db7510da375f87b10ed3d] | committer: Geoffrey Métais

Unregister callback on playlist append

Updates are sent after the append anyway

> https://code.videolan.org/videolan/vlc-android/commit/78ffb088bb5eb676fe4db7510da375f87b10ed3d
---

 vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt b/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
index 11fc46140..3f2a9acfa 100644
--- a/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
+++ b/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
@@ -626,7 +626,9 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
             load(list, 0)
             return
         }
+        mediaList.removeEventListener(this)
         for (media in list) mediaList.add(media)
+        mediaList.addEventListener(this)
     }
 
     /**



More information about the Android mailing list