From: Anthony Minessale Date: Mon, 27 Feb 2012 19:26:50 +0000 (-0600) Subject: only flush on break when its a blocking situation X-Git-Tag: v1.2-rc1~19^2^2~68^2~51^2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a0767865d5c1866b9beadbbd812dafc65229000;p=thirdparty%2Ffreeswitch.git only flush on break when its a blocking situation --- diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 5c966cde6e..d48d622baf 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -3097,9 +3097,12 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_BREAK) || (bytes && bytes == 4 && *((int *) &rtp_session->recv_msg) == UINT_MAX)) { switch_clear_flag_locked(rtp_session, SWITCH_RTP_FLAG_BREAK); - do_2833(rtp_session, session); - bytes = 0; - return_cng_frame(); + + if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_NOBLOCK) || switch_test_flag(rtp_session, SWITCH_RTP_FLAG_PROXY_MEDIA) || switch_test_flag(rtp_session, SWITCH_RTP_FLAG_UDPTL) || (bytes && bytes < 5) || (!bytes && poll_loop)) { + do_2833(rtp_session, session); + bytes = 0; + return_cng_frame(); + } } if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_FLUSH)) {