From fb9f84a7a6ebb85135a3c1698fba48a000d6eb45 Mon Sep 17 00:00:00 2001 From: Damontecres Date: Thu, 6 Nov 2025 16:44:50 -0500 Subject: [PATCH] Don't idle mpv --- .../damontecres/wholphin/ui/playback/PlaybackViewModel.kt | 1 + .../com/github/damontecres/wholphin/util/mpv/MpvPlayer.kt | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/playback/PlaybackViewModel.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/playback/PlaybackViewModel.kt index cc0866b3..8755500b 100644 --- a/app/src/main/java/com/github/damontecres/wholphin/ui/playback/PlaybackViewModel.kt +++ b/app/src/main/java/com/github/damontecres/wholphin/ui/playback/PlaybackViewModel.kt @@ -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}") diff --git a/app/src/main/java/com/github/damontecres/wholphin/util/mpv/MpvPlayer.kt b/app/src/main/java/com/github/damontecres/wholphin/util/mpv/MpvPlayer.kt index 5f47aaa9..9f1f738d 100644 --- a/app/src/main/java/com/github/damontecres/wholphin/util/mpv/MpvPlayer.kt +++ b/app/src/main/java/com/github/damontecres/wholphin/util/mpv/MpvPlayer.kt @@ -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 {