Releases the Mutex when stopping the feed.

This commit is contained in:
Vitor Pamplona
2023-07-21 20:49:57 -04:00
parent a6f56416e3
commit 7e03870c0b
@@ -531,6 +531,7 @@ private fun RenderVideoPlayer(
// if the user unmutes a video and it's not the current playing, switches to that one. // if the user unmutes a video and it's not the current playing, switches to that one.
if (!mute && keepPlayingMutex != null && keepPlayingMutex != controller) { if (!mute && keepPlayingMutex != null && keepPlayingMutex != controller) {
keepPlayingMutex?.stop() keepPlayingMutex?.stop()
keepPlayingMutex?.release()
keepPlayingMutex = null keepPlayingMutex = null
} }
@@ -542,6 +543,7 @@ private fun RenderVideoPlayer(
if (newKeepPlaying) { if (newKeepPlaying) {
if (keepPlayingMutex != null && keepPlayingMutex != controller) { if (keepPlayingMutex != null && keepPlayingMutex != controller) {
keepPlayingMutex?.stop() keepPlayingMutex?.stop()
keepPlayingMutex?.release()
} }
keepPlayingMutex = controller keepPlayingMutex = controller
} else { } else {