File tree Expand file tree Collapse file tree 2 files changed +2
-3
lines changed
Expand file tree Collapse file tree 2 files changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -394,8 +394,7 @@ impl FfiAudioStream {
394394 if let Some ( target) = target_samples {
395395 buf. extend_from_slice( & frame. data) ;
396396 while buf. len( ) >= target {
397- let data = buf. split_off( target) ;
398- let mut frame_data = std:: mem:: replace( & mut buf, data) ;
397+ let frame_data = buf. drain( ..target) . collect:: <Vec <_>>( ) ;
399398 let new_frame = AudioFrame {
400399 data: Cow :: Owned ( frame_data) ,
401400 sample_rate,
Original file line number Diff line number Diff line change @@ -294,7 +294,7 @@ impl Stream for AudioFilterAudioStream {
294294
295295 if this. buffer . len ( ) >= this. frame_size {
296296 let data = this. buffer . drain ( ..this. frame_size ) . collect :: < Vec < _ > > ( ) ;
297- let mut out: Vec < i16 > = Vec :: with_capacity ( this. frame_size ) ;
297+ let mut out: Vec < i16 > = vec ! [ 0 ; this. frame_size] ;
298298
299299 this. session . process_i16 ( this. frame_size , & data, & mut out) ;
300300
You can’t perform that action at this time.
0 commit comments