test/hfp: handle plc of sco frames with 120 samples

This commit is contained in:
Matthias Ringwald 2019-03-08 17:20:42 +01:00
parent 0d719a1e32
commit 163d9175bb

View File

@ -157,12 +157,18 @@ static void process_file(const char * pklg_path, const char * wav_path, int pack
}
if (plc_enabled){
btstack_cvsd_plc_process_data(&plc_state, audio_frame_in, num_samples, audio_frame_out);
if (num_samples > 60){
btstack_cvsd_plc_process_data(&plc_state, audio_frame_in, 60, audio_frame_out);
wav_writer_write_int16(60, audio_frame_out);
btstack_cvsd_plc_process_data(&plc_state, &audio_frame_in[60], num_samples - 60, audio_frame_out);
wav_writer_write_int16(num_samples - 60, audio_frame_out);
} else {
btstack_cvsd_plc_process_data(&plc_state, audio_frame_in, num_samples, audio_frame_out);
wav_writer_write_int16(num_samples, audio_frame_out);
}
} else {
memcpy(audio_frame_out, audio_frame_in, audio_bytes_read);
wav_writer_write_int16(num_samples, audio_frame_in);
}
wav_writer_write_int16(num_samples, audio_frame_out);
}
}