From 97e8c1d9908e5a20aeb55d959de6ec51288d74f4 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 28 Jan 2022 11:51:06 -0500 Subject: [PATCH] TT#109800 fix mismatched CN generator format Upsample output of DTX CN generator to match the format of the parent codec. Change-Id: Ic2de29a6b711a5258af25e8ec98decaf218d2ada --- lib/codeclib.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/codeclib.c b/lib/codeclib.c index 651b9026e..aa798ba04 100644 --- a/lib/codeclib.c +++ b/lib/codeclib.c @@ -2376,7 +2376,11 @@ static int generic_cn_dtx(decoder_t *dec, GQueue *out, int ptime) { } static int generic_cn_dtx_init(decoder_t *dec) { - dec->dtx.u.cn.cn_dec = decoder_new_fmt(codec_def_cn, 8000, 1, dec->ptime, &dec->dest_format); + // upsample CN output to same params as output of parent codec + format_t cn_format = dec->dest_format; + cn_format.channels = dec->in_format.channels; + cn_format.clockrate = dec->in_format.clockrate; + dec->dtx.u.cn.cn_dec = decoder_new_fmt(codec_def_cn, 8000, 1, dec->ptime, &cn_format); return 0; }