Commit 5708fa39 authored by Ghislain MARY's avatar Ghislain MARY

Fix build of chanadapt filter and basic audio tester.

parent 9bc8fa23
......@@ -75,6 +75,7 @@ static void adapter_process(MSFilter *f) {
if (buffer_size1 >= s->buffer_size || buffer_size2 >= s->buffer_size) {
mblk_t *om;
unsigned int i;
if (buffer_size1 < s->buffer_size) memset(s->buffer1, 0, s->buffer_size);
if (buffer_size2 < s->buffer_size) memset(s->buffer2, 0, s->buffer_size);
......@@ -84,7 +85,7 @@ static void adapter_process(MSFilter *f) {
om = allocb(s->buffer_size * 2, 0);
for (unsigned int i = 0 ; i < s->buffer_size / sizeof(int16_t) ; i++ , om->b_wptr += 4) {
for (i = 0 ; i < s->buffer_size / sizeof(int16_t) ; i++ , om->b_wptr += 4) {
((int16_t*)om->b_wptr)[0] = ((int16_t*)s->buffer1)[i];
((int16_t*)om->b_wptr)[1] = ((int16_t*)s->buffer2)[i];
}
......
......@@ -95,6 +95,7 @@ static void _silence_detection(const char* filename, unsigned int duration_thres
unsigned int enable_silence = 1;
char* recorded_file = bc_tester_res(filename);
MSFilterDesc *vad_desc = ms_factory_lookup_filter_by_name(msFactory, MSWEBRTC_VAD_FILTER_NAME);
int i;
if (!recorded_file) return;
......@@ -131,7 +132,7 @@ static void _silence_detection(const char* filename, unsigned int duration_thres
BC_ASSERT_EQUAL(silence_data.voice_detected_number, number_detection, int, "%d");
if (number_detection > 0 && number_detection == silence_data.voice_detected_number) {
for (int i = 0 ; i < number_detection-1 ; i++) {
for (i = 0 ; i < number_detection-1 ; i++) {
BC_ASSERT_LOWER_STRICT((unsigned long long)silence_data.silence_duration[i], (unsigned long long)(silence_duration[i] + delay), unsigned long long, "%llu");
BC_ASSERT_GREATER_STRICT((unsigned long long)silence_data.silence_duration[i], (unsigned long long)(silence_duration[i] - delay), unsigned long long, "%llu");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment