Skip to content

fix: start playback after a seek's landing is checked; make the lost-audio test cut the feed - #57

Merged
bilipp merged 3 commits into
mainfrom
fix/seek-landing-before-start
Oct 13, 2026
Merged

bilipp merged 3 commits into
mainfrom
fix/seek-landing-before-start

Conversation

@bilipp

@bilipp bilipp commented Oct 12, 2026

Copy link
Copy Markdown
Owner

Two tests that failed intermittently on CI after the strict cooperative pool (#48) slowed the runners down. One was a real ordering bug in the engine; the other was a gap in how a test faked a lost audio feed.

Seek landing vs. start. verifySeekLanding() checks a seek's landing against what reached the renderer. Playback started as soon as the lanes held enough decoded media, which can come before the render pump has enqueued anything. When it did, the clock ran from the requested target, and a landing seconds earlier pulled it back while playing. The failing CI runs show exactly that: got 45.0 → 30.0 and 45.0 → 21.4, from "resume-style seek over a range-less HTTP server keeps playing". The start now checks the landing first and keeps buffering until there is something to check it against, unless every lane has ended.

Lost-audio test. reportsLostAudio called audioRenderer.stopRequestingMediaData(). A pump retry already scheduled for an empty input kept feeding the renderer, so on a slow runner audio never starved (health is ok). The new SystemRenderer.stopFeedingAudio() (internal, tests only) stops the callback and the retries.

Neither failure reproduces on a fast machine. The seek test lands within the keyframe slack there. With the render pumps artificially delayed by 1.5 s, the start waits for the landing check as intended. 284 tests pass in strict-pool mode.

Stacked on #55 and #53; the diff is one commit on top of them.

SUBTITLE_BITMAP rects from avcodec_decode_subtitle2 were dropped. They
now become SubtitleImages on the cue: a premultiplied sRGB CGImage
(palette ARGB -> premultiplied BGRA) and a rect normalized to the
subtitle's authoring canvas as the decoder reports it after decoding
(DVB display definition, PGS presentation size, DVD size:), with a 720x576
fallback grown to fit the rects. The DVB context's size is zeroed before
opening so the stream's display definition decides it.

SubtitleCue gains images (defaulted, empty for text cues); bitmap cues
carry empty text, so text-only consumers keep working and show nothing.
The timeline treats an update with images as content rather than a clear,
deduplicates re-decoded bitmaps by position and size, and bounds bitmap
memory at 64 MB on top of the cue count. LumePlayer exposes the active
cues' images as subtitleImages; LumePlayerView has no subtitle overlay, so
drawing stays with the host.

Stacked on #46.
…adlessly

`lumectl probe <url>` opens a source and prints what it carries; `lumectl
play <url>` drives a muted PlayerSession against it and prints every
PlayerEvent with a timestamp, the Diagnostics heartbeat with the delivery
rate, the StartupTimeline once the first frame shows, lastStallReason on
every stall and the typed EngineError (with its HTTP class) on failure.
Text or JSON Lines, optionally recorded to a file. Exit status separates
ok, open failure, playback failure and stall; Ctrl-C shuts the session
down (bounded) and prints the summary.

URLs are printed as scheme and host only unless --show-urls, and header
values never, because IPTV URLs and headers carry the account.

The logic lives in LumeCtlCore and is tested from LumeEngineCoreTests,
which already owns the fixtures and the torture server: argument parsing,
URL redaction, JSON output, exit codes, and end-to-end runs (probe, play,
refused open, silent source, live source that ends, interrupt, SIGINT on
the built binary).
…ost-audio test cut the feed for real

A seek's landing is verified against what reached the renderer, but
playback could start as soon as the lanes filled, before the render pump
had enqueued anything. On a slow machine the clock then ran from the
requested target and a landing seconds earlier pulled it back mid-play
(CI: "clock must advance after the seek, got 45.0 → 30.0"). The start now
checks the landing first and keeps buffering until there is something to
check it against, unless every lane has ended.

The lost-audio test stopped the renderer's data requests, but a pump retry
already scheduled for an empty input went on feeding it, so on a slow
machine audio never starved. SystemRenderer.stopFeedingAudio() stops both.
@bilipp
bilipp merged commit 4cbb7ee into main Oct 13, 2026
4 of 5 checks passed
@bilipp
bilipp deleted the fix/seek-landing-before-start branch October 13, 2026 06:50
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.

1 participant