fix pts_scale: use capture fps (not declared 120) for timestamp correction

This commit is contained in:
2026-05-30 02:11:29 +03:00
parent d9266a4fba
commit c38bc04239
2 changed files with 8 additions and 6 deletions
+4 -2
View File
@@ -435,8 +435,9 @@ fn pause_capture(state: State<'_, AppState>) -> Result<(), String> {
let frames = session.frame_counter.load(std::sync::atomic::Ordering::Relaxed);
let raw_path = session.stop().map_err(|e| format!("{e:#}"))?;
let ffmpeg = bootstrap::ffmpeg_path(&state.app_dir);
let cap_fps = lock(&state.config).capture.default_fps;
let fixed_path = raw_path.with_extension("fixed.mp4");
capture::fix_intermediate_fps(&ffmpeg, &raw_path, &fixed_path, elapsed, frames)
capture::fix_intermediate_fps(&ffmpeg, &raw_path, &fixed_path, elapsed, frames, cap_fps)
.map_err(|e| format!("fixing fps: {e:#}"))?;
let path = if fixed_path.exists() { fixed_path } else { raw_path };
@@ -523,8 +524,9 @@ fn stop_capture(app: AppHandle, state: State<'_, AppState>) -> Result<RecordedCl
let frames = session.frame_counter.load(std::sync::atomic::Ordering::Relaxed);
let raw_path = session.stop().map_err(|e| format!("{e:#}"))?;
let ffmpeg = bootstrap::ffmpeg_path(&state.app_dir);
let cap_fps = lock(&state.config).capture.default_fps;
let fixed_path = raw_path.with_extension("fixed.mp4");
capture::fix_intermediate_fps(&ffmpeg, &raw_path, &fixed_path, elapsed, frames)
capture::fix_intermediate_fps(&ffmpeg, &raw_path, &fixed_path, elapsed, frames, cap_fps)
.map_err(|e| format!("fixing fps: {e:#}"))?;
let final_path = if fixed_path.exists() { fixed_path } else { raw_path };
ss.segments.push(final_path);