Files
leaguerecorder/docs/rune-upstream.md
T
vhaudiquet 5cbf284841 app: play a recording's own sound and read a pause's place from the player
The review screen carried two workarounds for rune's video player: tick
ignored the player's place while a clip was paused because the first
pause read zero, and the player was muted for good because its sound
never kept the clock, so the soundtrack came from an audio-only player
of the whole file, kept in step by keep_in_step.

Rune now holds the pause's picture and time and reads a video's sound
ahead of the clock, so the video player carries the sound of a
single-track recording itself, and tick reads the place whatever the
playback state. A recording with several tracks still cuts one player
per source, so the channels stay hearable apart; the video stays muted
and keep_in_step keeps those players with the pictures.
2026-11-22 23:54:00 +01:00

2.6 KiB

Rune fixes this app waits on (the first two are cherry-picked, see the note at the end)

Three faults live in rune, not here. Each one names the file, what happens, and how to check the fix. The app carries a workaround for the second and third.

1. A paused clip draws nothing

window/video_layer.rs takes a clip off its compositor layer as soon as it is not running, and pausing makes it not running. The window underneath then has to draw the clip itself, and Native::show in video/windows/mod.rs takes a frame only when nothing has been shown yet (Phase::Paused { .. } if self.shown.is_none()), so unlayer puts no picture on the surface. The window paints an empty surface, which reads as black.

Check: open a recording in the app, pause, the clip area is black while the same moment in the file is bright.

Cheapest fix first:

  • keep the layer while a clip is paused, instead of releasing it on status.running == false;
  • or, in unlayer, set shown = None before calling show, or put the newest pipe frame on the surface, so leaving the layer leaves a picture behind.

2. A layered clip reports zero as its place when paused

live_time in video/windows/mod.rs reads the compositor clock, and that clock stops with playback. The first pause therefore reads 0, which sends any caller's scrubber to the start.

Check: pause and ask Player::time(); it answers 0 while the clip sits near its end.

Fix: report nothing when the clip's clock has stopped, so time() falls back to the clip's own place.

3. One reader for pictures and sound stamps the sound wrong

A video player asks Media Foundation for both streams from one reader, and that reader stamps the sound from its own clock instead of the clip's. The sound then never lines up with the clock and plays silent.

Cherry-picks on the vendored checkout

Rune comes from app/vendor/rune, a checkout of 63ad0209 on branch ported, carrying two fixes cherry-picked from the upstream issues (both written against eb9f1104 and ported across the refactors that landed since):

  • #1320, two commits: a pause while a clip is layered holds the layer's newest picture and takes the pause's time from it, and the surface gets that picture when the window draws the clip again. This fixes faults 1 and 2 above.
  • #1325, two commits: a video's sound is read ahead of the clock on a reader of its own, and the sound leads the clock from the device's own position. This fixes fault 3 above.

app/Cargo.toml points rune, rune-kit and rune-notify at the checkout's crates by path. To take a newer upstream rev: fetch in app/vendor/rune, rebase or re-apply the four commits of ported on the new rev.