Skip to content

Commit b979d43

Browse files
author
flore.harle
committed
AEC3: remove obsolete file and functions. Clean code.
1 parent e96a953 commit b979d43

File tree

4 files changed

+21
-171
lines changed

4 files changed

+21
-171
lines changed

build/android/voipdescs.h

Lines changed: 0 additions & 132 deletions
This file was deleted.

include/mediastreamer2/msfactory.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -371,20 +371,6 @@ MS2_PUBLIC void ms_factory_set_echo_canceller_filter_name(MSFactory *obj, const
371371
*/
372372
MS2_PUBLIC const char *ms_factory_get_echo_canceller_filter_name(const MSFactory *obj);
373373

374-
/**
375-
* Set the name of the echo canceller filter to use.
376-
* @param[in] obj MSFactory object
377-
* @param[in] filtername The name of the echo canceller filter to use
378-
*/
379-
MS2_PUBLIC void ms_factory_set_echo_canceller_3_filter_name(MSFactory *obj, const char *filtername);
380-
381-
/**
382-
* Get the name of the echo canceller filter being used.
383-
* @param[in] obj MSFactory object
384-
* @return The name of the echo canceller filter being used
385-
*/
386-
MS2_PUBLIC const char *ms_factory_get_echo_canceller_3_filter_name(const MSFactory *obj);
387-
388374
MS2_PUBLIC const struct _MSFmtDescriptor *
389375
ms_factory_get_audio_format(MSFactory *obj, const char *mime, int rate, int channels, const char *fmtp);
390376

include/mediastreamer2/msinterfaces.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ typedef enum _MSRecorderState MSRecorderState;
179179
/** restore a previous state suppling the echo canceller config as base64 encoded string */
180180
#define MS_ECHO_CANCELLER_SET_STATE_STRING MS_FILTER_METHOD(MSFilterEchoCancellerInterface, 6, const char)
181181

182-
/** retrieve echo canceller current median delay applied */
182+
/** retrieve echo canceller current median delay applied in milliseconds*/
183183
#define MS_ECHO_CANCELLER_GET_DELAY MS_FILTER_METHOD(MSFilterEchoCancellerInterface, 7, int)
184184

185185
/** Event definitions for video decoders */

src/utils/audiodiff.c

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,10 @@ int ms_audio_compare_silence_and_speech(const char *ref_file,
450450
const int stop_time_short_ms,
451451
const int start_time_ms) {
452452

453-
FileInfo *fi1, *fi2;
453+
FileInfo *fi1 = NULL;
454+
FileInfo *fi2 = NULL;
455+
FileInfo *fi1_full = NULL;
456+
FileInfo *fi2_full = NULL;
454457
int max_shift_samples;
455458
int err = 0;
456459
ProgressContext pctx;
@@ -461,29 +464,14 @@ int ms_audio_compare_silence_and_speech(const char *ref_file,
461464
*ret = 0;
462465

463466
fi1 = file_info_new(ref_file);
464-
if (fi1 == NULL) return 0;
467+
if (fi1 == NULL) {
468+
err = -1;
469+
goto end;
470+
}
465471
fi2 = file_info_new(matched_file);
466472
if (fi2 == NULL) {
467-
file_info_destroy(fi1);
468-
return -1;
469-
}
470-
471-
FileInfo *fi1_short, *fi2_short;
472-
fi1_short = file_info_new(ref_file);
473-
if (fi1_short == NULL) return 0;
474-
fi2_short = file_info_new(matched_file);
475-
if (fi2_short == NULL) {
476-
file_info_destroy(fi1_short);
477-
return -1;
478-
}
479-
480-
FileInfo *fi1_full, *fi2_full;
481-
fi1_full = file_info_new(ref_file);
482-
if (fi1_full == NULL) return 0;
483-
fi2_full = file_info_new(matched_file);
484-
if (fi2_full == NULL) {
485-
file_info_destroy(fi1_full);
486-
return -1;
473+
err = -1;
474+
goto end;
487475
}
488476

489477
if (fi1->rate != fi2->rate) {
@@ -551,6 +539,16 @@ int ms_audio_compare_silence_and_speech(const char *ref_file,
551539
zero_pad_sample_fi1 = -maxpos;
552540
zero_pad_sample_fi2 = 0;
553541
}
542+
fi1_full = file_info_new(ref_file);
543+
if (fi1_full == NULL) {
544+
err = -1;
545+
goto end;
546+
}
547+
fi2_full = file_info_new(matched_file);
548+
if (fi2_full == NULL) {
549+
err = -1;
550+
goto end;
551+
}
554552
int start_sample = (int)(start_time_ms / 1000. * (double)fi1->rate);
555553
int size_samples_1 = fi1_full->nsamples - (int)(start_time_ms / 1000. * (double)fi1->rate);
556554
int size_samples_2 = fi2_full->nsamples - (int)(start_time_ms / 1000. * (double)fi2->rate);
@@ -572,8 +570,6 @@ int ms_audio_compare_silence_and_speech(const char *ref_file,
572570
end:
573571
file_info_destroy(fi1);
574572
file_info_destroy(fi2);
575-
file_info_destroy(fi1_short);
576-
file_info_destroy(fi2_short);
577573
file_info_destroy(fi1_full);
578574
file_info_destroy(fi2_full);
579575
return err;

0 commit comments

Comments
 (0)