Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(verify): start the gated Instant harness screen track at the arm point like the product

Richie McIlroyc480c6d35cea
diff --git a/crates/recording/src/output_pipeline/start_gate.rs b/crates/recording/src/output_pipeline/start_gate.rs
index 428407d3a..595f6e599 100644
--- a/crates/recording/src/output_pipeline/start_gate.rs
+++ b/crates/recording/src/output_pipeline/start_gate.rs
@@ -50,7 +50,7 @@ impl RecordingStartGate {
/// timeline starts where audio anchored at the recording epoch does.
/// Instant merges its tracks by timestamp; Studio aligns them with each
/// track's recorded start time instead and leaves this off.
- pub(crate) fn set_video_origin_at_arm(&self) {
+ pub fn set_video_origin_at_arm(&self) {
self.0.video_origin_at_arm.store(true, Ordering::Release);
}
diff --git a/crates/verify/expectations.toml b/crates/verify/expectations.toml
index 94233df4a..f4a44b29d 100644
--- a/crates/verify/expectations.toml
+++ b/crates/verify/expectations.toml
@@ -112,20 +112,6 @@ reason = "NEW: same anchor, loopback-style system audio (WASAPI delivers packets
link = ""
-[[xfail]]
-case = "export/instant-gated-*mic*/output/mp4/native"
-class = "sync-mic"
-bound = { count = 1, offset-ms = [5, 34] }
-reason = "NEW: after the start gate opens, the screen and audio pipelines each take their own first admitted frame as zero, so audio is late by up to one video frame (33.3 ms at 30 fps; 12.6 to 17.2 ms measured with the gate opening between frames)"
-link = ""
-
-[[xfail]]
-case = "export/instant-gated-system-*/output/mp4/native"
-class = "sync-system"
-bound = { count = 1, offset-ms = [5, 34] }
-reason = "NEW: the gate's per-pipeline zero, as the gated sync-mic entry: system audio late by up to one video frame (12.2 to 15.1 ms measured)"
-link = ""
-
[[xfail]]
case = "export/instant-gated-system-only/output/mp4/native"
class = "audio-system"
@@ -134,21 +120,6 @@ bound = { count = 1, missing = 2, lost = 2 }
reason = "NEW: gated loopback-only system audio sometimes loses markers (2 of 11 lost in 1 of 2 fresh recordings, with the track 958 ms early). Bound: at most 2 markers lost, none unexpected"
link = ""
-[[xfail]]
-case = "export/instant/output/mp4/native"
-class = "sync-mic"
-bound = { count = 1, offset-ms = [5, 34] }
-reason = "NEW: see export/instant-gated-*: mic audio up to one video frame late after the start gate (14.2 to 15.3 ms measured)"
-link = ""
-
-
-[[xfail]]
-case = "export/instant/output/mp4/native"
-class = "sync-system"
-bound = { count = 1, offset-ms = [5, 34], mic-offset-ms = [5, 34], system-minus-mic-ms = [-1, 1] }
-reason = "NEW: the mixer places system audio on the microphone's timeline (system minus mic 0 ms), so it shares the gated mic offset of the sync-mic entry above (13.3 to 15.4 ms measured)"
-link = ""
-
[[xfail]]
case = "*/basic/transition/*60*/avf"
class = "stale"
diff --git a/crates/verify/src/pipeline.rs b/crates/verify/src/pipeline.rs
index cf127cc65..75512c0fe 100644
--- a/crates/verify/src/pipeline.rs
+++ b/crates/verify/src/pipeline.rs
@@ -606,9 +606,13 @@ pub async fn record_instant(spec: &InstantSpec, dir: &Path) -> anyhow::Result<()
std::fs::create_dir_all(&content)?;
let timestamps = Timestamps::now();
let base = timestamps.instant();
- let gate = spec
- .arm_at
- .map(|_| cap_recording::RecordingStartGate::new());
+ // Mirrors the product's Instant gate: the screen track starts at the arm
+ // point, where the epoch-anchored audio below starts.
+ let gate = spec.arm_at.map(|_| {
+ let gate = cap_recording::RecordingStartGate::new();
+ gate.set_video_origin_at_arm();
+ gate
+ });
let mut emitted = Emitted {
fps: spec.screen.fps,
..Default::default()