From add9d26ac54291074ce0f82b971eaf7531a6c658 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 25 Feb 2011 15:20:04 -0600 Subject: [PATCH] fix regression in video from commit c565501f555a507fa2c56eccedccdbba7a366d6d --- src/mod/endpoints/mod_sofia/sofia_glue.c | 8 +++++--- src/switch_rtp.c | 9 ++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 66f5e52140..ac4196adfc 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -3242,7 +3242,9 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f } if (tech_pvt->audio_recv_pt != tech_pvt->agreed_pt) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_CRIT, "Set audio receive payload to %u\n", tech_pvt->audio_recv_pt); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, + "%s Set audio receive payload to %u\n", switch_channel_get_name(tech_pvt->channel), tech_pvt->audio_recv_pt); + switch_rtp_set_recv_pt(tech_pvt->rtp_session, tech_pvt->audio_recv_pt); } @@ -3427,8 +3429,8 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f if (tech_pvt->video_recv_pt != tech_pvt->video_agreed_pt) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, - "Set video receive payload to %u\n", tech_pvt->video_recv_pt); - switch_rtp_set_recv_pt(tech_pvt->rtp_session, tech_pvt->video_recv_pt); + "%s Set video receive payload to %u\n", switch_channel_get_name(tech_pvt->channel), tech_pvt->video_recv_pt); + switch_rtp_set_recv_pt(tech_pvt->video_rtp_session, tech_pvt->video_recv_pt); } switch_channel_set_variable_printf(tech_pvt->channel, "sip_use_video_pt", "%d", tech_pvt->video_agreed_pt); diff --git a/src/switch_rtp.c b/src/switch_rtp.c index b6b3832081..76b2c91b47 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -2304,7 +2304,8 @@ static void do_2833(switch_rtp_t *rtp_session, switch_core_session_t *session) SWITCH_DECLARE(void) rtp_flush_read_buffer(switch_rtp_t *rtp_session, switch_rtp_flush_t flush) { - if (switch_rtp_ready(rtp_session) && !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_PROXY_MEDIA)) { + if (switch_rtp_ready(rtp_session) && !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_PROXY_MEDIA) && + !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_VIDEO)) { switch_set_flag_locked(rtp_session, SWITCH_RTP_FLAG_FLUSH); switch (flush) { case SWITCH_RTP_FLUSH_STICK: @@ -2860,7 +2861,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ rtp_session->recv_msg.header.pt != 13 && rtp_session->recv_msg.header.pt != rtp_session->recv_te && (!rtp_session->cng_pt || rtp_session->recv_msg.header.pt != rtp_session->cng_pt) && - rtp_session->recv_msg.header.pt != rtp_session->rpayload) { + rtp_session->recv_msg.header.pt != rtp_session->rpayload && 0) { /* drop frames of incorrect payload number and return CNG frame instead */ return_cng_frame(); } @@ -2890,10 +2891,12 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ } if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_FLUSH)) { + if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_VIDEO)) { do_flush(rtp_session); - switch_clear_flag_locked(rtp_session, SWITCH_RTP_FLAG_FLUSH); bytes = 0; } + switch_clear_flag_locked(rtp_session, SWITCH_RTP_FLAG_FLUSH); + } if (bytes && bytes < 5) { continue;