Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(gpui): run the recording track heals before the editor opens a project

Richie McIlroyc2237fb286cd
diff --git a/apps/desktop-gpui/src/editor_window.rs b/apps/desktop-gpui/src/editor_window.rs
index 63c573308..6cec16f0d 100644
--- a/apps/desktop-gpui/src/editor_window.rs
+++ b/apps/desktop-gpui/src/editor_window.rs
@@ -362,6 +362,15 @@ pub fn preflight(path: &std::path::Path) -> Result<ProjectSummary, String> {
return Err(format!("Video path {} not found!", path.display()));
}
+ // Repairs tracks older recorders stamped at the wrong rate, and display
+ // fps that finalization replaced with the average rate, before anything
+ // reads them. Non-fatal: the editor opens the files as they are.
+ match cap_recording::track_heal::heal_stretched_tracks(path) {
+ Ok(true) => tracing::info!(?path, "Healed recording tracks"),
+ Ok(false) => {}
+ Err(error) => tracing::warn!(?path, "Track heal check failed: {error:#}"),
+ }
+
let meta = RecordingMeta::load_for_project(path)
.map_err(|error| format!("Failed to load recording meta: {error}"))?;