Don't idle mpv

This commit is contained in:
Damontecres 2025-11-06 16:44:50 -05:00
parent e781276046
commit fb9f84a7a6
No known key found for this signature in database
2 changed files with 3 additions and 2 deletions

View file

@ -405,6 +405,7 @@ class PlaybackViewModel
enableDirectStream = !forceTranscoding,
)
player.prepare()
player.play()
this@PlaybackViewModel.chapters.value = Chapter.fromDto(base, api)
Timber.v("chapters=${this@PlaybackViewModel.chapters.value?.size}")

View file

@ -103,8 +103,7 @@ class MpvPlayer(
MPVLib.setOptionString("demuxer-max-back-bytes", "${cacheMegs * 1024 * 1024}")
MPVLib.setOptionString("force-window", "no")
// need to idle at least once for playFile() logic to work
MPVLib.setOptionString("idle", "once")
MPVLib.setOptionString("idle", "yes")
MPVLib.addObserver(this)
MPVProperty.observedProperties.forEach(MPVLib::observeProperty)
@ -201,6 +200,7 @@ class MpvPlayer(
if (DEBUG) Timber.v("prepare")
durationMs = 0L
positionMs = -1L
playbackState = STATE_READY
}
override fun getPlaybackState(): Int {