drop excess frames on loopback channel

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13156 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2009-04-26 22:10:05 +00:00
parent 972fe26b49
commit e4117136fc
2 changed files with 29 additions and 10 deletions

View File

@@ -31,6 +31,7 @@
*
*/
//#define DEBUG_2833
#define RTP_DEBUG_WRITE_DELTA
#include <switch.h>
#include <switch_stun.h>
#undef PACKAGE_NAME
@@ -203,6 +204,11 @@ struct switch_rtp {
uint32_t cng_count;
switch_rtp_bug_flag_t rtp_bugs;
switch_rtp_stats_t stats;
#ifdef RTP_DEBUG_WRITE_DELTA
switch_time_t send_time;
#endif
};
static int global_init = 0;
@@ -2229,6 +2235,18 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
bytes = sbytes;
}
#undef RTP_DEBUG_WRITE_DELTA
#ifdef RTP_DEBUG_WRITE_DELTA
{
switch_time_t now = switch_time_now();
int delta = (int) (now - rtp_session->send_time) / 1000;
//assert(delta);
//printf("WRITE %d delta %d\n", (int)bytes, delta);
rtp_session->send_time = now;
}
#endif
if (switch_socket_sendto(rtp_session->sock_output, rtp_session->remote_addr, 0, (void *) send_msg, &bytes) != SWITCH_STATUS_SUCCESS) {
rtp_session->seq--;
ret = -1;