TT#101653 alter re-invite codec negotiation logic

Change-Id: Ic5f68258b6f1f10af1df42ff8b06d82488595c35
pull/1126/head
Richard Fuchs 5 years ago
parent f0a29d0c5c
commit 16fd8aad15

@ -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);

@ -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);

Loading…
Cancel
Save