Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fmt

Richie McIlroy6b7861de0991
diff --git a/apps/desktop/src/routes/screenshot-editor/context.tsx b/apps/desktop/src/routes/screenshot-editor/context.tsx
index 99336b240..e9cddf949 100644
--- a/apps/desktop/src/routes/screenshot-editor/context.tsx
+++ b/apps/desktop/src/routes/screenshot-editor/context.tsx
@@ -259,11 +259,7 @@ function createScreenshotEditorContext() {
}
try {
- const imageData = new ImageData(
- processedData.buffer as unknown as ImageDataArray,
- width,
- height,
- );
+ const imageData = new ImageData(processedData, width, height);
const bitmap = await createImageBitmap(imageData);
const existing = latestFrame();
if (existing?.bitmap && existing.bitmap !== bitmap) {
diff --git a/crates/rendering/src/decoder/mod.rs b/crates/rendering/src/decoder/mod.rs
index 1ea1707ef..0a5b4a289 100644
--- a/crates/rendering/src/decoder/mod.rs
+++ b/crates/rendering/src/decoder/mod.rs
@@ -548,8 +548,8 @@ pub async fn spawn_decoder(
let (ready_tx, ready_rx) = oneshot::channel::<Result<DecoderInitResult, String>>();
let (tx, rx) = mpsc::channel();
- match media_foundation::MFDecoder::spawn(name, path.clone(), fps, rx, ready_tx) {
- Ok(()) => match tokio::time::timeout(timeout_duration, ready_rx).await {
+ if let Ok(()) = media_foundation::MFDecoder::spawn(name, path.clone(), fps, rx, ready_tx) {
+ match tokio::time::timeout(timeout_duration, ready_rx).await {
Ok(Ok(Ok(init_result))) => {
info!(
"Video '{}' using {} decoder ({}x{})",
@@ -585,8 +585,7 @@ pub async fn spawn_decoder(
name
);
}
- },
- Err(_) => {}
+ }
}
let fallback_reason =
diff --git a/crates/rendering/src/layers/display.rs b/crates/rendering/src/layers/display.rs
index 03ae2a0d0..005beb6fb 100644
--- a/crates/rendering/src/layers/display.rs
+++ b/crates/rendering/src/layers/display.rs
@@ -213,25 +213,25 @@ impl DisplayLayer {
screen_frame.d3d11_y_handle(),
screen_frame.d3d11_uv_handle(),
) {
- match self.yuv_converter.convert_nv12_from_d3d11_shared_handles(
- device,
- queue,
- y_handle,
- uv_handle,
- actual_width,
- actual_height,
- ) {
- Ok(_) => {
- if self.yuv_converter.output_texture().is_some() {
- self.pending_copy = Some(PendingTextureCopy {
- width: actual_width,
- height: actual_height,
- dst_texture_index: next_texture,
- });
- d3d11_succeeded = true;
- }
- }
- Err(_) => {}
+ if self
+ .yuv_converter
+ .convert_nv12_from_d3d11_shared_handles(
+ device,
+ queue,
+ y_handle,
+ uv_handle,
+ actual_width,
+ actual_height,
+ )
+ .is_ok()
+ && self.yuv_converter.output_texture().is_some()
+ {
+ self.pending_copy = Some(PendingTextureCopy {
+ width: actual_width,
+ height: actual_height,
+ dst_texture_index: next_texture,
+ });
+ d3d11_succeeded = true;
}
}