Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **CoreAudio**: Streams no longer start automatically on creation; call `play()` manually.
- **CoreAudio (iOS)**: `default_input_config()` and `default_output_config()` now prefer 48 kHz,
then 44.1 kHz, then the maximum supported sample rate, instead of always taking the maximum.
- **CoreAudio (iOS)**: `default_output_config()` now prefers stereo over the maximum channel count.
- **JACK**: Timestamps now use the precise hardware deadline.
- **JACK**: Buffer size change no longer invokes the error callback; internal buffers are resized
without error.
Expand Down
15 changes: 8 additions & 7 deletions src/host/coreaudio/ios/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,14 @@ impl Device {
}

fn default_output_config(&self) -> Result<SupportedStreamConfig, Error> {
// Get the maximum channel count config from supported configs
let range = get_supported_stream_configs(false).last().ok_or_else(|| {
Error::with_message(
ErrorKind::UnsupportedConfig,
"No supported output configuration",
)
})?;
let range = get_supported_stream_configs(false)
.max_by(|a, b| a.cmp_default_heuristics(b))
.ok_or_else(|| {
Error::with_message(
ErrorKind::UnsupportedConfig,
"No supported output configuration",
)
})?;
Ok(range
.try_with_standard_sample_rate()
.unwrap_or_else(|| range.with_max_sample_rate()))
Expand Down
Loading