diff --git a/src/backend/mod.rs b/src/backend/mod.rs index 1155692e..855c119b 100644 --- a/src/backend/mod.rs +++ b/src/backend/mod.rs @@ -207,7 +207,11 @@ impl From for mixer::Channel { sys::kAudioChannelLabel_TopBackCenter => mixer::Channel::TopBackCenter, sys::kAudioChannelLabel_TopBackRight => mixer::Channel::TopBackRight, sys::kAudioChannelLabel_Unknown => mixer::Channel::Discrete, - _ => panic!("Label not handled"), + sys::kAudioChannelLabel_Unused => mixer::Channel::Silence, + v => { + eprintln!("Warning: channel label value {} isn't handled", v); + mixer::Channel::Silence + } } } } diff --git a/src/backend/tests/api.rs b/src/backend/tests/api.rs index 5ce2374a..ea08a5ef 100644 --- a/src/backend/tests/api.rs +++ b/src/backend/tests/api.rs @@ -376,7 +376,6 @@ fn test_get_default_device_id_with_inout_type() { #[test] fn test_convert_channel_layout() { let pairs = [ - (vec![kAudioObjectUnknown], vec![mixer::Channel::Silence]), ( vec![kAudioChannelLabel_Mono], vec![mixer::Channel::FrontCenter], @@ -398,7 +397,7 @@ fn test_convert_channel_layout() { vec![ mixer::Channel::FrontLeft, mixer::Channel::FrontRight, - mixer::Channel::Silence, + mixer::Channel::Discrete, ], ), (