From 16fd8aad15dff25562649e393ff0f43964f1f191 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 2 Dec 2020 13:00:14 -0500 Subject: [PATCH] TT#101653 alter re-invite codec negotiation logic Change-Id: Ic5f68258b6f1f10af1df42ff8b06d82488595c35 --- daemon/codec.c | 3 +-- t/transcode-test.c | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/daemon/codec.c b/daemon/codec.c index 640a89eb3..de43b9b82 100644 --- a/daemon/codec.c +++ b/daemon/codec.c @@ -1070,7 +1070,7 @@ void codec_handlers_update(struct call_media *receiver, struct call_media *sink, for (GList *l = receiver->codecs_prefs_recv.head; l; ) { struct rtp_payload_type *pt = l->data; - if (MEDIA_ISSET(sink, TRANSCODE)) { + if (MEDIA_ISSET(sink, TRANSCODE) && flags && flags->opmode == OP_ANSWER) { // if the other side is transcoding, we may come across a receiver entry // (recv->recv) that wasn't originally offered (recv->send). we must eliminate // those, unless we added them ourselves for transcoding. @@ -2665,7 +2665,6 @@ static int __revert_codec_strip(GHashTable *stripped, GHashTable *masked, const STR_FMT(codec), q->length); while (q->length) { struct rtp_payload_type *pt = g_queue_pop_head(q); - pt->for_transcoding = 1; __rtp_payload_type_add_recv(media, pt, 1); } g_hash_table_remove(masked, codec); diff --git a/t/transcode-test.c b/t/transcode-test.c index e33e20d78..abf7cb80d 100644 --- a/t/transcode-test.c +++ b/t/transcode-test.c @@ -107,6 +107,7 @@ static void __sdp_pt_fmt(int num, str codec, int clockrate, str full_codec, str static void offer(void) { printf("offer\n"); + flags.opmode = OP_OFFER; codec_tracker_init(media_B); codec_rtp_payload_types(media_B, media_A, &rtp_types, &flags); codec_handlers_update(media_B, media_A, &flags, NULL); @@ -117,6 +118,7 @@ static void offer(void) { static void answer(void) { printf("answer\n"); + flags.opmode = OP_ANSWER; codec_tracker_init(media_A); codec_rtp_payload_types(media_A, media_B, &rtp_types, &flags); codec_handlers_update(media_A, media_B, &flags, NULL);