Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

clippy

Richie McIlroyd3ffa4cd29ff
diff --git a/crates/recording/examples/camera-benchmark.rs b/crates/recording/examples/camera-benchmark.rs
index 5ad07ad52..8d99d5a4e 100644
--- a/crates/recording/examples/camera-benchmark.rs
+++ b/crates/recording/examples/camera-benchmark.rs
@@ -292,12 +292,16 @@ async fn run_camera_encoding_benchmark(
let encode_start = Instant::now();
let timestamp = Duration::from_micros(converted.frame.pts().unwrap_or(0) as u64);
- if let Ok(()) =
- encoder.queue_preconverted_frame(converted.frame, timestamp, &mut output)
- {
- let encode_duration = encode_start.elapsed();
- let pipeline_latency = converted.submit_time.elapsed();
- metrics.record_frame_encoded(encode_duration, pipeline_latency);
+ match encoder.queue_preconverted_frame(converted.frame, timestamp, &mut output) {
+ Ok(()) => {
+ let encode_duration = encode_start.elapsed();
+ let pipeline_latency = converted.submit_time.elapsed();
+ metrics.record_frame_encoded(encode_duration, pipeline_latency);
+ }
+ Err(e) => {
+ warn!("Encode error during drain: {}", e);
+ metrics.record_dropped_output();
+ }
}
} else {
break;
diff --git a/crates/recording/src/output_pipeline/macos_segmented_ffmpeg.rs b/crates/recording/src/output_pipeline/macos_segmented_ffmpeg.rs
index 092faa097..b5091ea55 100644
--- a/crates/recording/src/output_pipeline/macos_segmented_ffmpeg.rs
+++ b/crates/recording/src/output_pipeline/macos_segmented_ffmpeg.rs
@@ -386,7 +386,9 @@ impl MacOSSegmentedMuxer {
}
Err(e) => {
error!("Encoder setup failed: {:#}", e);
- let _ = ready_tx.send(Err(anyhow!("{e}")));
+ if let Err(send_err) = ready_tx.send(Err(anyhow!("{e}"))) {
+ error!("failed to send ready_tx error: {send_err}");
+ }
return Err(anyhow!("{e}"));
}
};