ignore pipe error on capture stop - last frame write race condition is harmless if output file has content

This commit is contained in:
2026-05-28 15:43:37 +03:00
parent d4db7cca31
commit 2da660fa23
+4 -3
View File
@@ -285,9 +285,10 @@ fn compute_output_dims(monitor_w: u32, monitor_h: u32, crop: Option<CaptureRect>
impl CaptureSession {
pub fn stop(self) -> Result<PathBuf> {
self.control
.stop()
.map_err(|e| anyhow!("capture stop: {e}"))?;
// Ignore errors from control.stop() - the last frame write often fails
// with "pipe is being closed" when stopping. If the output file has content,
// the capture was successful.
let _ = self.control.stop();
let meta = std::fs::metadata(&self.output_path)
.with_context(|| format!("checking output file {}", self.output_path.display()))?;
if meta.len() == 0 {