[Android] PlayerController: prevent IllegalStateException

Geoffrey Métais git at videolan.org
Wed Mar 6 15:14:48 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Mar  6 15:11:52 2019 +0100| [5245d311aca8d2ef485dfc7d78a0f6c670930e29] | committer: Geoffrey Métais

PlayerController: prevent IllegalStateException

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

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

diff --git a/vlc-android/src/org/videolan/vlc/media/PlayerController.kt b/vlc-android/src/org/videolan/vlc/media/PlayerController.kt
index 135863f09..818732987 100644
--- a/vlc-android/src/org/videolan/vlc/media/PlayerController.kt
+++ b/vlc-android/src/org/videolan/vlc/media/PlayerController.kt
@@ -226,6 +226,7 @@ class PlayerController(val context: Context) : IVLCVout.Callback, MediaPlayer.Ev
     fun getLength() = progress.value?.length ?: 0L
 
     fun setRate(rate: Float, save: Boolean) {
+        if (mediaplayer.isReleased) return
         mediaplayer.rate = rate
         if (save && settings.getBoolean(PreferencesActivity.KEY_PLAYBACK_SPEED_PERSIST, false))
             settings.edit().putFloat(PreferencesActivity.KEY_PLAYBACK_RATE, rate).apply()



More information about the Android mailing list