Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(audio): idle-pause only the built-in output

Richie McIlroy1e771ef2f704
diff --git a/crates/audio/src/latency.rs b/crates/audio/src/latency.rs
index 38058d162..c2059e9ff 100644
--- a/crates/audio/src/latency.rs
+++ b/crates/audio/src/latency.rs
@@ -452,10 +452,10 @@ pub fn default_output_latency_hint(
}
}
-/// Whether the default output device is local hardware whose stream can be
-/// stopped while idle and restarted within a callback period or two.
-/// Wireless, AirPlay and display outputs are excluded because they can drop
-/// the start of audio or take seconds to wake after their stream stops.
+/// Whether the default output device is the built-in output, whose stream can
+/// be stopped while idle and restarted within a callback period or two.
+/// External, wireless, AirPlay and display outputs keep running because some
+/// drop the start of audio or take seconds to wake after their stream stops.
pub fn default_output_supports_idle_pause() -> bool {
#[cfg(target_os = "macos")]
{
@@ -591,16 +591,7 @@ mod macos {
System::default_output_device()
.ok()
.and_then(|device| device.transport_type().ok())
- .is_some_and(|transport| {
- matches!(
- transport,
- DeviceTransportType::BUILT_IN
- | DeviceTransportType::USB
- | DeviceTransportType::PCI
- | DeviceTransportType::FIRE_WIRE
- | DeviceTransportType::THUNDERBOLT
- )
- })
+ .is_some_and(|transport| transport == DeviceTransportType::BUILT_IN)
}
pub(super) fn estimate_input_latency(