Skip to content

Waveform: stop the cursor immediately on every pause path#12253

Merged
niksedk merged 2 commits into
mainfrom
fix/waveform-cursor-pause-freeze-12233
Jul 7, 2026
Merged

Waveform: stop the cursor immediately on every pause path#12253
niksedk merged 2 commits into
mainfrom
fix/waveform-cursor-pause-freeze-12233

Conversation

@niksedk

@niksedk niksedk commented Jul 7, 2026

Copy link
Copy Markdown
Member

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 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".

Changes

  • PlayPauseRequested now carries intent (wasPlaying, captured before the toggle since mpv's IsPlaying lags the pause command) and is raised from the toolbar button, video-surface click and TogglePlayPause.
  • InitVideoPlayer.MakeLayoutVideoPlayer wires it (docked + undocked players) to RequestPausePlayheadFreeze; the fullscreen player is wired at its creation site.
  • 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 (dialog opening, subtitle single/double-click pause actions, waveform click pause actions, play-selection end) route through a PauseVideoAndFreezePlayhead helper. Transient pause-then-play paths (PlayNext etc.) keep pinning instead — a lingering freeze would hold the cursor for up to 300 ms after Play().
  • Small reconciles after pause/stop (the ~100 ms mpv keeps playing after a pause request, or the stop-pin's 0.15 s arrival tolerance) are eased over ~160 ms instead of snapped, removing the tiny cursor jump that remained after the settle window. Real seeks beyond the 0.5 s resync threshold still snap; the playing branch is unchanged.

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

niksedk and others added 2 commits July 7, 2026 22:36
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>
@niksedk niksedk merged commit 07b969a into main Jul 7, 2026
1 of 3 checks passed
@niksedk niksedk deleted the fix/waveform-cursor-pause-freeze-12233 branch July 7, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cursor keeps moving after pausing playback in Waveform

1 participant