File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -403,16 +403,22 @@ where
403403 burst_size = 16 ; // floor from Oboe
404404 }
405405
406- let mixer_bursts = tuning_for_callback
406+ let new_mixer_bursts = tuning_for_callback
407407 . mixer_bursts
408- . fetch_add ( 1 , Ordering :: Relaxed ) ;
409- let mut buffer_size = burst_size * mixer_bursts;
408+ . load ( Ordering :: Relaxed )
409+ . saturating_add ( 1 ) ;
410+ let mut buffer_size = burst_size * new_mixer_bursts;
410411
411412 let buffer_capacity = tuning_for_callback. capacity . load ( Ordering :: Relaxed ) ;
412413 if buffer_size > buffer_capacity {
413414 buffer_size = buffer_capacity;
414415 }
415- let _ = stream. set_buffer_size_in_frames ( buffer_size) ;
416+
417+ if stream. set_buffer_size_in_frames ( buffer_size) . is_ok ( ) {
418+ tuning_for_callback
419+ . mixer_bursts
420+ . store ( new_mixer_bursts, Ordering :: Relaxed ) ;
421+ }
416422
417423 tuning_for_callback
418424 . previous_underrun_count
You can’t perform that action at this time.
0 commit comments