Commit d2cbd83c authored by Geoffrey Métais's avatar Geoffrey Métais

Player: release media immediately

parent 279192c6
......@@ -181,14 +181,15 @@ class PlayerController : IVLCVout.Callback, MediaPlayer.EventListener {
}
fun setSlaves(media: Media, mw: MediaWrapper) = launch(UI, CoroutineStart.UNDISPATCHED) {
val slaves = mw.slaves
slaves?.let { for (slave in it) media.addSlave(slave) }
media.release()
val list = withContext(CommonPool) {
mw.slaves?.let {
for (slave in it) media.addSlave(slave)
MediaDatabase.getInstance().saveSlaves(mw)
MediaDatabase.getInstance().run {
if (slaves != null) saveSlaves(mw)
getSlaves(mw.location)
}
MediaDatabase.getInstance().getSlaves(mw.location)
}
media.release()
for (slave in list) mediaplayer.addSlave(slave.type, Uri.parse(slave.uri), false)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment