File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -300,19 +300,15 @@ impl Device {
300300 let buffer_size = get_io_buffer_frame_size_range ( & audio_unit) ?;
301301
302302 // Collect the supported formats for the device.
303- let mut fmts = vec ! [ ] ;
304- for range in ranges {
305303 let fmt = SupportedStreamConfigRange {
306304 channels : n_channels as ChannelCount ,
307- min_sample_rate : SampleRate ( range . mMinimum as _ ) ,
308- max_sample_rate : SampleRate ( range . mMaximum as _ ) ,
305+ min_sample_rate : SampleRate ( ranges . iter ( ) . map ( |v| v . mMinimum as u32 ) . min ( ) . unwrap ( ) ) ,
306+ max_sample_rate : SampleRate ( ranges . iter ( ) . map ( |v| v . mMaximum as u32 ) . max ( ) . unwrap ( ) ) ,
309307 buffer_size,
310308 sample_format,
311309 } ;
312- fmts. push ( fmt) ;
313- }
314310
315- Ok ( fmts . into_iter ( ) )
311+ Ok ( vec ! [ fmt ] . into_iter ( ) )
316312 }
317313 }
318314
You can’t perform that action at this time.
0 commit comments