You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get a panic due to a failing unwrap in audio_playback_device_spec on macOS when trying to get the spec of the first device which is an external HDMI display (I hope the backtrace is useful, as it isn't a native one):
Backtrace (most recent call last):
File "~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sdl2-0.36.0/src/sdl2/audio.rs:202", in sdl2::audio::<impl sdl2::sdl::AudioSubsystem>::audio_playback_device_spec
Ok(AudioSpec::convert_from_ll(spec))
File "~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sdl2-0.36.0/src/sdl2/audio.rs:721", in sdl2::audio::AudioSpec::convert_from_ll
format: AudioFormat::from_ll(spec.format).unwrap(),
File "rust:library/core/src/option.rs:935", in core::option::Option<T>::unwrap
File "rust:library/core/src/panicking.rs:127", in core::panicking::panic
I would expect audio_playback_device_spec to return an error instead.
It looks like audio_playback_device_spec is new in 0.36, which isn't mentioned in the changelog afaict (and the tag is missing in the repository).
The text was updated successfully, but these errors were encountered:
This is coming from AudioFormat::from_ll(spec.format).unwrap(), which means that spec.format is not recognized.
Otherwise yes, we could avoid this panic by changing AudioSpec::convert_from_ll to return Result<AudioSpec, ()> instead of AudioSpec and panicking on unrecognized spec format.
Great wrapper!
I get a panic due to a failing unwrap in
audio_playback_device_spec
on macOS when trying to get the spec of the first device which is an external HDMI display (I hope the backtrace is useful, as it isn't a native one):I would expect
audio_playback_device_spec
to return an error instead.It looks like
audio_playback_device_spec
is new in 0.36, which isn't mentioned in the changelog afaict (and the tag is missing in the repository).The text was updated successfully, but these errors were encountered: