[Android] BrowserProvider: Don't send to channel once closed

Geoffrey Métais git at videolan.org
Thu Sep 27 16:51:20 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Sep 27 16:50:18 2018 +0200| [18394918345fe5378d050d9f5629aa7e82ff53a7] | committer: Geoffrey Métais

BrowserProvider: Don't send to channel once closed

> https://code.videolan.org/videolan/vlc-android/commit/18394918345fe5378d050d9f5629aa7e82ff53a7
---

 vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt b/vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt
index c251e5c14..3666022fc 100644
--- a/vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt
+++ b/vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt
@@ -177,7 +177,7 @@ abstract class BrowserProvider(val context: Context, val dataset: LiveDataset<Me
         }
     }
 
-    override fun onMediaAdded(index: Int, media: Media) { browserChannel.offer(media) }
+    override fun onMediaAdded(index: Int, media: Media) { if (!browserChannel.isClosedForReceive) browserChannel.offer(media) }
     override fun onBrowseEnd() { browserChannel.close() }
     override fun onMediaRemoved(index: Int, media: Media){}
 



More information about the Android mailing list