Fixed a crash when setting playback speed for Crossfade

This commit is contained in:
Prathamesh More 2022-05-16 10:47:29 +05:30
parent 3956d84310
commit 30dd58af93

View file

@ -355,8 +355,10 @@ class CrossFadePlayer(val context: Context) : Playback, MediaPlayer.OnCompletion
override fun setPlaybackSpeedPitch(speed: Float, pitch: Float) { override fun setPlaybackSpeedPitch(speed: Float, pitch: Float) {
getCurrentPlayer()?.setPlaybackSpeedPitch(speed, pitch) getCurrentPlayer()?.setPlaybackSpeedPitch(speed, pitch)
if (getNextPlayer()?.isPlaying == true) {
getNextPlayer()?.setPlaybackSpeedPitch(speed, pitch) getNextPlayer()?.setPlaybackSpeedPitch(speed, pitch)
} }
}
companion object { companion object {
val TAG: String = CrossFadePlayer::class.java.simpleName val TAG: String = CrossFadePlayer::class.java.simpleName