From ff1f376650b992542118b3685c2c902682346239 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 23 Jun 2008 18:26:08 +0000 Subject: [PATCH] deal with complex codec mapping bs git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8823 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_sofia/sofia_glue.c | 6 +++--- src/switch_rtp.c | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 4fb1a0f2ae..1ec66c065c 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -132,9 +132,9 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, uint32 if (tech_pvt->rm_encoding) { rate = tech_pvt->rm_rate; - switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=rtpmap:%d %s/%d\n", tech_pvt->pt, tech_pvt->rm_encoding, rate); + switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=rtpmap:%d %s/%d\n", tech_pvt->agreed_pt, tech_pvt->rm_encoding, rate); if (tech_pvt->fmtp_out) { - switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=fmtp:%d %s\n", tech_pvt->pt, tech_pvt->fmtp_out); + switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=fmtp:%d %s\n", tech_pvt->agreed_pt, tech_pvt->fmtp_out); } if (tech_pvt->read_codec.implementation && !ptime) { ptime = tech_pvt->read_codec.implementation->microseconds_per_frame / 1000; @@ -229,7 +229,7 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, uint32 /*****************************/ if (tech_pvt->video_rm_encoding) { sofia_glue_tech_set_video_codec(tech_pvt, 0); - switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %d", tech_pvt->video_pt); + switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %d", tech_pvt->video_agreed_pt); } else if (tech_pvt->num_codecs) { int i; int already_did[128] = { 0 }; diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 913597a803..25913a673e 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -1914,6 +1914,9 @@ SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_fra send_msg = frame->packet; len = frame->packetlen; ts = 0; + if (frame->codec && frame->codec->agreed_pt == frame->payload) { + send_msg->header.pt = payload; + } } else { data = frame->data; len = frame->datalen;