]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
tweaks
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 30 Sep 2008 17:24:04 +0000 (17:24 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 30 Sep 2008 17:24:04 +0000 (17:24 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9761 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_rtp.c
src/switch_time.c

index 807c3c7374c650418d27a5168690062120c824fa..93826992080995cedb53954a81439cb62bd6ce91 100644 (file)
@@ -760,7 +760,6 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_create(switch_rtp_t **new_rtp_session
                                                                                                  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 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_create(switch_rtp_t **new_rtp_session
 
 
        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 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
        }
 
        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();
        }
index bec5c9556f08b38edd72d57e278df8a63acab699..4f566e40f2957284dae067c777b9d66b0fd11c46 100644 (file)
@@ -139,6 +139,15 @@ SWITCH_DECLARE(void) switch_time_sync(void)
 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 @@ SWITCH_DECLARE(void) switch_sleep(switch_interval_time_t t)
 #else
        apr_sleep(t);
 #endif
-
+#endif
 
 }