From f39b3129841ab01d455cff08139bcd7b17fa0d33 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 10 Sep 2020 13:00:55 -0400 Subject: [PATCH] TT#92250 use matching output codec with inject-DTMF Change-Id: I220947872303c534368363e8f980b94bd7d406a5 (cherry picked from commit 74fd959cccf57d8b9491466b63419db0ea6c3045) (cherry picked from commit fe6d8251bd65727bc83c549ae181df3a492f4ab8) --- daemon/codec.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/daemon/codec.c b/daemon/codec.c index fef965222..0ca5b7c39 100644 --- a/daemon/codec.c +++ b/daemon/codec.c @@ -1007,8 +1007,6 @@ void codec_handlers_update(struct call_media *receiver, struct call_media *sink, // we ignore output codec matches if we must transcode DTMF if (dtmf_pt && !reverse_dtmf_pt) ; - else if (flags && flags->inject_dtmf) - ; else dest_codecs = g_hash_table_lookup(sink->codec_names_send, &pt->encoding); } @@ -1042,6 +1040,13 @@ void codec_handlers_update(struct call_media *receiver, struct call_media *sink, goto transcode; } + if (flags && flags->inject_dtmf) { + // we have a matching output codec, but we were told that we might + // want to inject DTMF, so we must still go through our transcoding + // engine, despite input and output codecs being the same. + goto transcode; + } + // XXX check format parameters as well ilog(LOG_DEBUG, "Sink supports codec " STR_FORMAT, STR_FMT(&pt->encoding_with_params)); __make_passthrough_gsl(handler, &passthrough_handlers);