[Freeswitch-svn] [commit] r9761 - freeswitch/trunk/src
Freeswitch SVN
anthm at freeswitch.org
Tue Sep 30 13:24:05 EDT 2008
Author: anthm
Date: Tue Sep 30 13:24:04 2008
New Revision: 9761
Modified:
freeswitch/trunk/src/switch_rtp.c
freeswitch/trunk/src/switch_time.c
Log:
tweaks
Modified: freeswitch/trunk/src/switch_rtp.c
==============================================================================
--- freeswitch/trunk/src/switch_rtp.c (original)
+++ freeswitch/trunk/src/switch_rtp.c Tue Sep 30 13:24:04 2008
@@ -760,7 +760,6 @@
switch_rtp_flag_t flags, char *timer_name, const char **err, switch_memory_pool_t *pool)
{
switch_rtp_t *rtp_session = NULL;
- uint32_t ssrc = rand() & 0xffffffff;
*new_rtp_session = NULL;
@@ -792,7 +791,7 @@
rtp_session->seq = (uint16_t) rand();
- rtp_session->ssrc = ssrc;
+ rtp_session->ssrc = (uint32_t) ((intptr_t) &rtp_session + (uint32_t) switch_timestamp(NULL));
rtp_session->send_msg.header.ssrc = htonl(rtp_session->ssrc);
rtp_session->send_msg.header.ts = 0;
rtp_session->send_msg.header.m = 0;
@@ -1247,7 +1246,7 @@
}
if (rtp_session->timer.interval) {
- sleep_mss = 1000;//rtp_session->timer.interval * 1000;
+ sleep_mss = rtp_session->timer.interval * 1000;
} else {
rtp_session->last_time = switch_time_now();
}
Modified: freeswitch/trunk/src/switch_time.c
==============================================================================
--- freeswitch/trunk/src/switch_time.c (original)
+++ freeswitch/trunk/src/switch_time.c Tue Sep 30 13:24:04 2008
@@ -139,6 +139,15 @@
SWITCH_DECLARE(void) switch_sleep(switch_interval_time_t t)
{
+#if defined(HAVE_USLEEP)
+ usleep(t);
+#elif defined(WIN32)
+ Sleep((DWORD) ((t) / 1000));
+#else
+ apr_sleep(t);
+#endif
+
+#if 0
#if defined(HAVE_CLOCK_NANOSLEEP) && defined(SWITCH_USE_CLOCK_FUNCS)
struct timespec ts;
ts.tv_sec = t / APR_USEC_PER_SEC;
@@ -153,7 +162,7 @@
#else
apr_sleep(t);
#endif
-
+#endif
}
More information about the Freeswitch-svn
mailing list