prepare the restored track so the first play is instant

Restore set the window with autoplay = false and never prepared, so the first tap paid
for the connection, the first range request and the startup buffer. Prepare once the
window is set; toggling play then only starts playback.
This commit is contained in:
austinried
2026-10-04 00:30:00 +00:00
parent ea09f24844
commit 3bcf87b5b4
2 changed files with 5 additions and 2 deletions
@@ -662,6 +662,7 @@ class PlaybackController(
val position = queueRepository.cursor().coerceIn(0, snapshot.size - 1)
lastSavedPositionMs = queueRepository.cursorPositionMs().coerceAtLeast(0)
loadWindow(position, autoplay = false, startPositionMs = lastSavedPositionMs)
player?.prepare()
}
private suspend fun stop() = startLock.withLock { stopLocked() }