File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -299,13 +299,10 @@ impl Device {
299299 } ) ;
300300 Ok ( res. collect :: < Vec < _ > > ( ) . into_iter ( ) )
301301 } else {
302- let values = ranges. into_iter ( ) . map ( |v| v. mMinimum as u32 ) ; //assume that all mMinimum and mMaximum values are the same
303- let min = values. clone ( ) . min ( ) . expect ( "the list must not be empty" ) ;
304- let max = values. max ( ) . expect ( "the list must not be empty" ) ;
305302 let fmt = SupportedStreamConfigRange {
306303 channels : n_channels as ChannelCount ,
307- min_sample_rate : SampleRate ( min) ,
308- max_sample_rate : SampleRate ( max) ,
304+ min_sample_rate : SampleRate ( ranges . into_iter ( ) . map ( |v| v . mMinimum as u32 ) . min ( ) . expect ( "the list must not be empty" ) ) ,
305+ max_sample_rate : SampleRate ( ranges . into_iter ( ) . map ( |v| v . mMaximum as u32 ) . max ( ) . expect ( "the list must not be empty" ) ) ,
309306 buffer_size,
310307 sample_format,
311308 } ;
You can’t perform that action at this time.
0 commit comments