mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-09-11 06:51:00 +03:00
fix(audio): restart capture when the device is unavailable (#16142)
* fix(audio): restart capture when the device is unavailable * refact: remove low-value test Signed-off-by: fufesou <linlong1266@gmail.com> --------- Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -11,7 +11,10 @@ pub(super) struct CaptureErrorHandler {
|
|||||||
|
|
||||||
impl CaptureErrorHandler {
|
impl CaptureErrorHandler {
|
||||||
pub(super) fn handle(&self, error: cpal::StreamError) {
|
pub(super) fn handle(&self, error: cpal::StreamError) {
|
||||||
if matches!(error, cpal::StreamError::StreamInterrupted { .. }) {
|
if matches!(
|
||||||
|
error,
|
||||||
|
cpal::StreamError::StreamInterrupted { .. } | cpal::StreamError::DeviceNotAvailable
|
||||||
|
) {
|
||||||
// ScreenCaptureKit can stop capture while the remote session stays open.
|
// ScreenCaptureKit can stop capture while the remote session stays open.
|
||||||
// The observed -3821 error does not identify its underlying trigger.
|
// The observed -3821 error does not identify its underlying trigger.
|
||||||
// https://developer.apple.com/documentation/screencapturekit/scstreamdelegate/stream(_:didstopwitherror:)
|
// https://developer.apple.com/documentation/screencapturekit/scstreamdelegate/stream(_:didstopwitherror:)
|
||||||
|
|||||||
Reference in New Issue
Block a user