From c109168bae6f48dbf12216b68d3609cedccadce1 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 11 Jul 2023 15:17:16 -0400 Subject: [PATCH] MT#55283 pull forward creation of codec_handlers This HT is needed when updating UDPTL/T.38 handlers, on both sides of the call. Make sure the HT exists. Change-Id: Ic85684bbd2a746ff490d06008eadfae664e9f8a9 --- daemon/codec.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/daemon/codec.c b/daemon/codec.c index 3019ef664..35c06b935 100644 --- a/daemon/codec.c +++ b/daemon/codec.c @@ -1013,6 +1013,11 @@ void codec_handlers_update(struct call_media *receiver, struct call_media *sink, MEDIA_CLEAR(receiver, GENERATOR); MEDIA_CLEAR(sink, GENERATOR); + if (!receiver->codec_handlers) + receiver->codec_handlers = g_hash_table_new(__codec_handler_hash, __codec_handler_eq); + if (!sink->codec_handlers) + sink->codec_handlers = g_hash_table_new(__codec_handler_hash, __codec_handler_eq); + // non-RTP protocol? if (proto_is(receiver->protocol, PROTO_UDPTL)) { if (codec_handler_udptl_update(receiver, sink, flags)) { @@ -1029,9 +1034,6 @@ void codec_handlers_update(struct call_media *receiver, struct call_media *sink, return; } - if (!receiver->codec_handlers) - receiver->codec_handlers = g_hash_table_new(__codec_handler_hash, __codec_handler_eq); - // should we transcode to a non-RTP protocol? if (proto_is_not_rtp(sink->protocol)) { if (codec_handler_non_rtp_update(receiver, sink, flags, sp)) {