Skip to content

feat(seek): asynchronous seek with cached preview - #78

Merged
blocksmith314 merged 1 commit into
mainfrom
feature/async-seek-preview
Nov 26, 2026
Merged

blocksmith314 merged 1 commit into
mainfrom
feature/async-seek-preview

Conversation

@blocksmith314

Copy link
Copy Markdown
Owner

Summary

Makes frame selection non-blocking and adds a cached preview (part of #70).

  • DecoderService::RequestSeek(frame, generation): runs in the worker thread, returns a cache hit immediately, otherwise emits PreviewReady with the nearest cached frame and then decodes the exact frame (FrameReady).
  • FrameCache moved into the service and gained Nearest().
  • MainWindow::ShowFrameAt() now only enqueues a request; display, labels, audio seek and the performance log happen in the FrameReady slot. Results with an older generation are discarded.
  • The initial frame after loading stays synchronous so the window has content on return.
  • Raw playback keeps a seek_pending_ guard; container playback still uses blocking DecodeNext for now.

Verification

  • ctest: 75/75 pass (GUI tests now use QTRY_COMPARE/QTRY_VERIFY for async results).
  • tidy.sh on the changed files: 0 issues.
  • Cache-hit path logs cache ... frame=N; cache misses log seek timings from the service.

Remaining for #70

Refs #70

Add DecoderService::RequestSeek(frame, generation), which runs in the
worker thread, answers cache hits immediately and otherwise emits a preview
from the nearest cached frame before decoding and emitting the exact frame.
The service now owns the FrameCache.

MainWindow requests seeks asynchronously, ignores results whose generation
is stale, and moves the display/audio/perf-log side effects to the
FrameReady slot. The initial frame after loading stays synchronous so the
window shows content before returning. GUI tests wait for the async result.

Refs #70
@blocksmith314
blocksmith314 merged commit 179dbf7 into main Nov 26, 2026
5 of 6 checks passed
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