Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

silence some errors

Brendan Allanf1999acc032a
diff --git a/apps/desktop-solid/src-tauri/src/display.rs b/apps/desktop-solid/src-tauri/src/display.rs
index bccc67b0c..6efadca3c 100644
--- a/apps/desktop-solid/src-tauri/src/display.rs
+++ b/apps/desktop-solid/src-tauri/src/display.rs
@@ -158,7 +158,10 @@ pub async fn start_capturing(
let mut file = File::create(&pipe_path).unwrap();
loop {
- frame_rx.changed().await.unwrap();
+ if frame_rx.changed().await.is_err() {
+ println!("Closing display pipe writer");
+ return;
+ }
let frame = frame_rx.borrow();
file.write_all(&frame).ok();
diff --git a/apps/desktop-solid/src-tauri/src/lib.rs b/apps/desktop-solid/src-tauri/src/lib.rs
index 2e77ba54b..3d6984561 100644
--- a/apps/desktop-solid/src-tauri/src/lib.rs
+++ b/apps/desktop-solid/src-tauri/src/lib.rs
@@ -18,12 +18,6 @@ use cap_ffmpeg::FFmpeg;
use cap_project::ProjectConfiguration;
use display::{list_capture_windows, Bounds, CaptureTarget};
use editor_instance::{EditorInstance, EditorState, FRAMES_WS_PATH};
-use ffmpeg_sidecar::{
- command::ffmpeg_is_installed,
- download::{check_latest_version, download_ffmpeg_package, ffmpeg_download_url, unpack_ffmpeg},
- paths::sidecar_dir,
- version::ffmpeg_version,
-};
use image::{ImageBuffer, Rgba};
use mp4::Mp4Reader;
use num_traits::ToBytes;
diff --git a/apps/desktop-solid/src-tauri/src/upload.rs b/apps/desktop-solid/src-tauri/src/upload.rs
index ea0c5dff5..7dce35083 100644
--- a/apps/desktop-solid/src-tauri/src/upload.rs
+++ b/apps/desktop-solid/src-tauri/src/upload.rs
@@ -1,10 +1,7 @@
// credit @filleduchaos
-use mp4::Mp4Reader;
use reqwest::{multipart::Form, Client, StatusCode};
-use std::fs::File;
-use std::io::{BufReader, Read, Write};
-use std::path::{Path, PathBuf};
+use std::path::PathBuf;
#[derive(serde::Deserialize)]
struct S3UploadMeta {
diff --git a/crates/rendering/src/decoder.rs b/crates/rendering/src/decoder.rs
index f59fc7d44..9a9b98449 100644
--- a/crates/rendering/src/decoder.rs
+++ b/crates/rendering/src/decoder.rs
@@ -270,7 +270,7 @@ impl AsyncVideoDecoderHandle {
self.sender
.send(VideoDecoderMessage::GetFrame(frame_number, tx))
.unwrap();
- rx.await.unwrap()
+ rx.await.ok().flatten()
}
}