From 2fcb876aced4c5dd4090c6c7415254eb6ff1c972 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 4 Apr 2025 09:15:24 -0400 Subject: [PATCH] MT#55283 discard packets if no DTX buffer exists If a packet is received for a codec that should have an active DTX but doesn't, drop the packet instead of forwarding it without being processed. In this case we expect that some other codec has an active DTX buffer, and forwarding the packet would interfere with a clean output stream. Change-Id: I162ba6f314b804123a6a3957feb7435a319ad2b9 --- daemon/codec.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/daemon/codec.c b/daemon/codec.c index d065513e1..01d2aab14 100644 --- a/daemon/codec.c +++ b/daemon/codec.c @@ -3287,8 +3287,13 @@ static bool __buffer_dtx(struct dtx_buffer *dtxb, struct codec_ssrc_handler *dec struct transcode_packet *packet, struct media_packet *mp)) { - if (!dtxb || !mp->sfd || !mp->ssrc_in || !mp->ssrc_out) - return false; + if (!dtxb || !mp->sfd || !mp->ssrc_in || !mp->ssrc_out) { + if (!__dtx_should_do(decoder_handler)) + return false; + ilogs(dtx, LOG_INFO | LOG_FLAG_LIMIT, "No DTX buffer, discarding packet"); + __transcode_packet_free(packet); + return true; + } unsigned long ts = packet ? packet->ts : 0;