Skip to content

Commit 9d18f6e

Browse files
authored
make audio capture send (#958)
* make audio capture send * string
1 parent 1cb811d commit 9d18f6e

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

  • crates/recording/src/sources/screen_capture

crates/recording/src/sources/screen_capture/windows.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ enum SourceError {
197197
#[error("CreateAudioCapture/{0}")]
198198
CreateAudioCapture(scap_cpal::CapturerError),
199199
#[error("StartCapturingAudio/{0}")]
200-
StartCapturingAudio(SendError<audio::StartCapturing, cpal::PlayStreamError>),
200+
StartCapturingAudio(
201+
String, /* SendError<audio::StartCapturing, cpal::PlayStreamError> */
202+
),
201203
#[error("Closed")]
202204
Closed,
203205
}
@@ -289,7 +291,7 @@ impl PipelineSourceTask for ScreenCaptureSource<AVFrameCapture> {
289291
audio_capture
290292
.ask(audio::StartCapturing)
291293
.await
292-
.map_err(SourceError::StartCapturingAudio)?;
294+
.map_err(|v| SourceError::StartCapturingAudio(v.to_string()))?;
293295

294296
Some(audio_capture)
295297
} else {
@@ -467,6 +469,8 @@ pub mod audio {
467469
capturer: scap_cpal::Capturer,
468470
}
469471

472+
unsafe impl Send for WindowsAudioCapture {}
473+
470474
impl WindowsAudioCapture {
471475
pub fn new(
472476
audio_tx: Sender<(ffmpeg::frame::Audio, f64)>,

0 commit comments

Comments
 (0)