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 @@ -321,13 +321,10 @@ impl Device {
321321 } ) ;
322322 Ok ( res. collect :: < Vec < _ > > ( ) . into_iter ( ) )
323323 } else {
324- let values = ranges. into_iter ( ) . map ( |v| v. mMinimum as u32 ) ; //assume that all mMinimum and mMaximum values are the same
325- let min = values. clone ( ) . min ( ) . expect ( "the list must not be empty" ) ;
326- let max = values. max ( ) . expect ( "the list must not be empty" ) ;
327324 let fmt = SupportedStreamConfigRange {
328325 channels : n_channels as ChannelCount ,
329- min_sample_rate : SampleRate ( min) ,
330- max_sample_rate : SampleRate ( max) ,
326+ min_sample_rate : SampleRate ( ranges . into_iter ( ) . map ( |v| v . mMinimum as u32 ) . min ( ) . expect ( "the list must not be empty" ) ) ,
327+ max_sample_rate : SampleRate ( ranges . into_iter ( ) . map ( |v| v . mMaximum as u32 ) . max ( ) . expect ( "the list must not be empty" ) ) ,
331328 buffer_size,
332329 sample_format,
333330 } ;
You can’t perform that action at this time.
0 commit comments