Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

fix(preview): hold the last frame for the webcam too when presenting past the end

EtienneLescot83fbcecc0dac
diff --git a/crates/compositor/src/live.rs b/crates/compositor/src/live.rs
index 925dda2a8..8224118e3 100644
--- a/crates/compositor/src/live.rs
+++ b/crates/compositor/src/live.rs
@@ -602,9 +602,11 @@ impl Player {
/// `set_time`, incorrect au-delà de 6s sur un enregistrement réel).
pub unsafe fn present_frame(&mut self, comp: &Compositor, cfg: &Cfg, target_sec: f64) -> Result<bool> {
let sf = self.sdec.seek_to_or_last(target_sec)?;
+ // La webcam aussi : sans caméra, `wdec` rouvre le fichier écran, et une cible au-delà de
+ // sa dernière image laisserait la frame sans webcam, donc non composée.
let wf = self
.wdec
- .seek_to(webcam_seek_time(target_sec, self.webcam_offset_sec))?;
+ .seek_to_or_last(webcam_seek_time(target_sec, self.webcam_offset_sec))?;
if sf.is_null() || wf.is_null() {
self.has_current_frame = false;
return Ok(false);