playback: fix improper re-initializaiton
Fix issues stemming from how ExoPlayer apparently doesn't send a playWhenReady event after being stopped. This ended up breaking AudioEffect integration and notification posting. I really don't know why player.stop() doesn't do this.
This commit is contained in:
@@ -226,8 +226,11 @@ class PlaybackService :
|
||||
if (song == null) {
|
||||
// No song, stop playback and foreground state.
|
||||
logD("Nothing playing, stopping playback")
|
||||
// For some reason the player does not mark playWhenReady as false when stopped,
|
||||
// which then completely breaks any re-initialization if playback starts again.
|
||||
// So we manually set it to false here.
|
||||
player.playWhenReady = false
|
||||
player.stop()
|
||||
|
||||
stopAndSave()
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user