[Android] Ensure media will always be released

Geoffrey Métais git at videolan.org
Mon Jun 11 11:39:37 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Jun 11 11:39:18 2018 +0200| [cf4fb41f4060c9f1abad1b01bf2157db8aacc7c8] | committer: Geoffrey Métais

Ensure media will always be released

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

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

diff --git a/vlc-android/src/org/videolan/vlc/media/PlayerController.kt b/vlc-android/src/org/videolan/vlc/media/PlayerController.kt
index 8cf5fc977..a08e6d7d7 100644
--- a/vlc-android/src/org/videolan/vlc/media/PlayerController.kt
+++ b/vlc-android/src/org/videolan/vlc/media/PlayerController.kt
@@ -195,11 +195,11 @@ class PlayerController : IVLCVout.Callback, MediaPlayer.EventListener {
         val list = withContext(VLCIO) {
             mw.slaves?.let {
                 for (slave in it) media.addSlave(slave)
-                media.release()
                 MediaDatabase.getInstance().saveSlaves(mw)
             }
             MediaDatabase.getInstance().getSlaves(mw.location)
         }
+        media.release()
         for (slave in list) mediaplayer.addSlave(slave.type, Uri.parse(slave.uri), false)
     }
 



More information about the Android mailing list