mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-25 18:47:07 -06:00
Problem: scrubbing a long movie showed the frame under the pointer seconds after the pointer stopped. Every viewer frame a free frame-pool thread had started kept running: each seeked the movie's one decoder and decoded up to a GOP, and the newest frame waited behind all of them on the decoder's lock (45 min 1080p H.264/HEVC, GOP 250: 1.8-3.6 s for the last frame of a drag; a single jump is 0.1-0.4 s). FilmCraft's decoder already polls a cancellation flag, but nothing set one. Fix: FootageSource::cancellable / called_off and CancellableFootage (a per-render view whose frame reads run under the render's own flag, so reads on other threads answer to the right render). MediaPool runs them under filmcraft_media::cancel::with_cancel. The frame workers render through it, and a newer viewer frame calls off the comp's running viewer frames of other times. A called-off render is not cached (frames, disk, layer cache). Drag latency is now 0.1-0.3 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>