Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Stop audio and video concurrently in pipeline

Richie McIlroyfb205783b5b6
diff --git a/crates/recording/src/instant_recording.rs b/crates/recording/src/instant_recording.rs
index e1b53d046..abd6f3ffa 100644
--- a/crates/recording/src/instant_recording.rs
+++ b/crates/recording/src/instant_recording.rs
@@ -132,12 +132,15 @@ impl Actor {
});
if let Some(pipeline) = pipeline {
- if let Some(audio) = pipeline.audio
- && let Err(e) = audio.stop().await
- {
- warn!("Audio pipeline stop failed (video continues): {e:#}");
+ if let Some(audio) = pipeline.audio {
+ let (audio_res, video_res) = tokio::join!(audio.stop(), pipeline.video.stop());
+ if let Err(e) = audio_res {
+ warn!("Audio pipeline stop failed: {e:#}");
+ }
+ video_res?;
+ } else {
+ pipeline.video.stop().await?;
}
- pipeline.video.stop().await?;
}
Ok(())