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)) {