Waveform: stop the cursor immediately on every pause path#12253
Merged
Conversation
The #12033 follow-up froze the interpolated waveform cursor the instant a pause is requested, but only for the ViewModel command paths (spacebar / Pause shortcut). Pausing via the video player's own toolbar button or a click on the video surface bypassed it: those paths call PlayOrPause() directly inside VideoPlayerControl, and the PlayPauseRequested event had no subscribers. The cursor then kept gliding until mpv's polled IsPlaying flipped ~100 ms later, and any estimate-vs-mpv drift showed up as a late slide after the settle window - 'cursor keeps moving after pausing'. - PlayPauseRequested now carries intent (wasPlaying, captured before the toggle since mpv's IsPlaying lags the pause command) and is raised from the toolbar button, surface click and TogglePlayPause. - InitVideoPlayer wires it (docked + undocked players) to RequestPausePlayheadFreeze; the fullscreen player is wired at creation. - The Stop button now freezes and pins the cursor to 0 immediately instead of lingering until mpv reports the new position. - All pause-and-stay call sites in MainViewModel (dialogs, subtitle single/double-click and waveform click pause actions, play-selection end) route through a PauseVideoAndFreezePlayhead helper. Transient pause-then-play paths keep pinning instead, as a lingering freeze would hold the cursor for up to 300 ms after Play. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…apping After the pause-settle window (or when a stop-pin's arrival tolerance released), the interpolated cursor snapped to mpv's settled position. The residual - the ~100 ms mpv keeps playing after a pause request, or the 0.15 s stop-pin arrival tolerance - showed as a tiny visible jump shortly after pausing/stopping. Close small gaps with a per-tick ease (~160 ms to converge) while paused; real seeks beyond the resync threshold still snap, and the playing branch is unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #12233
The #12033 follow-up froze the interpolated waveform cursor the instant a pause is requested, but only for the ViewModel command paths (spacebar / Pause shortcut). Pausing via the video player's own toolbar button or a click on the video surface bypassed it: those paths call
PlayOrPause()directly insideVideoPlayerControl, and thePlayPauseRequestedevent had no subscribers. The cursor then kept gliding until mpv's polledIsPlayingflipped ~100 ms later, and any estimate-vs-mpv drift showed up as a late slide after the settle window — "cursor keeps moving after pausing".Changes
PlayPauseRequestednow carries intent (wasPlaying, captured before the toggle since mpv'sIsPlayinglags the pause command) and is raised from the toolbar button, video-surface click andTogglePlayPause.InitVideoPlayer.MakeLayoutVideoPlayerwires it (docked + undocked players) toRequestPausePlayheadFreeze; the fullscreen player is wired at its creation site.MainViewModel(dialog opening, subtitle single/double-click pause actions, waveform click pause actions, play-selection end) route through aPauseVideoAndFreezePlayheadhelper. Transient pause-then-play paths (PlayNextetc.) keep pinning instead — a lingering freeze would hold the cursor for up to 300 ms afterPlay().Verified manually on macOS: pausing via the player toolbar button, clicking the video surface, and the stop button now stop the cursor on the click, with no residual glide or late jump.
🤖 Generated with Claude Code