fix: defer MPV playback start until user unpauses on session restore
Instead of play → pause → sleep → seek when restoring a paused session, introduce loadTrackPaused which sets internal state and fires UI/OS callbacks (song change, paused) without touching MPV. On Continue(), detect pendingLoadPaused and start MPV playback from the saved position. Also triggers waveform pre-generation for the paused track via the onBeforeSongChange hook. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
ce3ae4f15a
commit
dba540861f
+1
-5
@@ -683,11 +683,7 @@ func (a *App) LoadSavedPlayQueue() error {
|
||||
}
|
||||
|
||||
if playQueue.TrackIndex >= 0 && playQueue.TrackIndex < len(playQueue.Tracks) {
|
||||
// TODO: This isn't ideal but doesn't seem to cause an audible play-for-a-split-second artifact
|
||||
a.PlaybackManager.PlayTrackAt(playQueue.TrackIndex)
|
||||
a.PlaybackManager.Pause()
|
||||
time.Sleep(100 * time.Millisecond) // MPV seek fails if run quickly after
|
||||
a.PlaybackManager.SeekSeconds(playQueue.TimePos)
|
||||
a.PlaybackManager.LoadTrackPaused(playQueue.TrackIndex, playQueue.TimePos)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user