@@ -387,7 +387,7 @@ impl Device {
387
387
}
388
388
}
389
389
390
- if rates. len ( ) == 0 {
390
+ if rates. is_empty ( ) {
391
391
vec ! [ ( min_rate, max_rate) ]
392
392
} else {
393
393
rates
@@ -423,11 +423,11 @@ impl Device {
423
423
for channels in supported_channels. iter ( ) {
424
424
for & ( min_rate, max_rate) in sample_rates. iter ( ) {
425
425
output. push ( SupportedStreamConfigRange {
426
- channels : channels. clone ( ) ,
426
+ channels : * channels,
427
427
min_sample_rate : SampleRate ( min_rate as u32 ) ,
428
428
max_sample_rate : SampleRate ( max_rate as u32 ) ,
429
429
buffer_size : buffer_size_range. clone ( ) ,
430
- sample_format : sample_format ,
430
+ sample_format,
431
431
} ) ;
432
432
}
433
433
}
@@ -912,9 +912,12 @@ impl Stream {
912
912
let ( tx, rx) = trigger ( ) ;
913
913
// Clone the handle for passing into worker thread.
914
914
let stream = inner. clone ( ) ;
915
- let thread = thread:: spawn ( move || {
916
- input_stream_worker ( rx, & * stream, & mut data_callback, & mut error_callback) ;
917
- } ) ;
915
+ let thread = thread:: Builder :: new ( )
916
+ . name ( "cpal_alsa_in" . to_owned ( ) )
917
+ . spawn ( move || {
918
+ input_stream_worker ( rx, & * stream, & mut data_callback, & mut error_callback) ;
919
+ } )
920
+ . unwrap ( ) ;
918
921
Stream {
919
922
thread : Some ( thread) ,
920
923
inner,
@@ -934,9 +937,12 @@ impl Stream {
934
937
let ( tx, rx) = trigger ( ) ;
935
938
// Clone the handle for passing into worker thread.
936
939
let stream = inner. clone ( ) ;
937
- let thread = thread:: spawn ( move || {
938
- output_stream_worker ( rx, & * stream, & mut data_callback, & mut error_callback) ;
939
- } ) ;
940
+ let thread = thread:: Builder :: new ( )
941
+ . name ( "cpal_alsa_out" . to_owned ( ) )
942
+ . spawn ( move || {
943
+ output_stream_worker ( rx, & * stream, & mut data_callback, & mut error_callback) ;
944
+ } )
945
+ . unwrap ( ) ;
940
946
Stream {
941
947
thread : Some ( thread) ,
942
948
inner,
0 commit comments