# HG changeset patch # User Mychaela Falconia # Date 1627606247 0 # Node ID f7e946389f8b5ae40b252425d668210af04ad1fe # Parent 516066ac5bc1c18101ff26c426d2631988a9ddc9 tiaud-compile: add support for aec-new diff -r 516066ac5bc1 -r f7e946389f8b ffstools/tiaud/compile.c --- a/ffstools/tiaud/compile.c Fri Jul 30 00:23:05 2021 +0000 +++ b/ffstools/tiaud/compile.c Fri Jul 30 00:50:47 2021 +0000 @@ -16,6 +16,7 @@ #include "binstruct.h" struct audio_cfg_bin bin; +int is_new_aec; char *infname; FILE *inf; @@ -562,20 +563,20 @@ } static void -aec_setting(args) - char *args; +aec_setting(name, nwords, args) + char *name, *args; { char *cp, *np; int n; cp = args; - for (n = 0; n < 5; n++) { + for (n = 0; n < nwords; n++) { while (isspace(*cp)) cp++; if (*cp == '\0' || *cp == '#') { argcount_err: fprintf(stderr, - "%s line %d: aec setting takes 5 arguments\n", - infname, lineno); + "%s line %d: %s setting takes %d arguments\n", + infname, lineno, name, nwords); exit(1); } for (np = cp; *cp && !isspace(*cp); cp++) @@ -612,9 +613,13 @@ speaker_head_line(cp); else if (!strcmp(np, "sidetone")) sidetone_setting(cp); - else if (!strcmp(np, "aec")) - aec_setting(cp); - else { + else if (!strcmp(np, "aec")) { + is_new_aec = 0; + aec_setting("aec", 5, cp); + } else if (!strcmp(np, "aec-new")) { + is_new_aec = 1; + aec_setting("aec-new", 12, cp); + } else { fprintf(stderr, "%s line %d: unknown top-level setting \"%s\"\n", infname, lineno, np); @@ -633,7 +638,8 @@ perror(filename); exit(1); } - write(fd, &bin, MODE_FILE_SIZE_OLDAEC); + write(fd, &bin, + is_new_aec ? MODE_FILE_SIZE_NEWAEC : MODE_FILE_SIZE_OLDAEC); close(fd); }