Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

make audio capture send (#958)

Brendan Allan9d18f6e6bd64
diff --git a/crates/recording/src/sources/screen_capture/windows.rs b/crates/recording/src/sources/screen_capture/windows.rs
index e8edaae4e..0898d2ae0 100644
--- a/crates/recording/src/sources/screen_capture/windows.rs
+++ b/crates/recording/src/sources/screen_capture/windows.rs
@@ -197,7 +197,9 @@ enum SourceError {
#[error("CreateAudioCapture/{0}")]
CreateAudioCapture(scap_cpal::CapturerError),
#[error("StartCapturingAudio/{0}")]
- StartCapturingAudio(SendError<audio::StartCapturing, cpal::PlayStreamError>),
+ StartCapturingAudio(
+ String, /* SendError<audio::StartCapturing, cpal::PlayStreamError> */
+ ),
#[error("Closed")]
Closed,
}
@@ -289,7 +291,7 @@ impl PipelineSourceTask for ScreenCaptureSource<AVFrameCapture> {
audio_capture
.ask(audio::StartCapturing)
.await
- .map_err(SourceError::StartCapturingAudio)?;
+ .map_err(|v| SourceError::StartCapturingAudio(v.to_string()))?;
Some(audio_capture)
} else {
@@ -467,6 +469,8 @@ pub mod audio {
capturer: scap_cpal::Capturer,
}
+ unsafe impl Send for WindowsAudioCapture {}
+
impl WindowsAudioCapture {
pub fn new(
audio_tx: Sender<(ffmpeg::frame::Audio, f64)>,