tweaks
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9761 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
f051179c60
commit
f53f621185
|
@ -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_flag_t flags, char *timer_name, const char **err, switch_memory_pool_t *pool)
|
||||||
{
|
{
|
||||||
switch_rtp_t *rtp_session = NULL;
|
switch_rtp_t *rtp_session = NULL;
|
||||||
uint32_t ssrc = rand() & 0xffffffff;
|
|
||||||
|
|
||||||
*new_rtp_session = NULL;
|
*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->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.ssrc = htonl(rtp_session->ssrc);
|
||||||
rtp_session->send_msg.header.ts = 0;
|
rtp_session->send_msg.header.ts = 0;
|
||||||
rtp_session->send_msg.header.m = 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) {
|
if (rtp_session->timer.interval) {
|
||||||
sleep_mss = 1000;//rtp_session->timer.interval * 1000;
|
sleep_mss = rtp_session->timer.interval * 1000;
|
||||||
} else {
|
} else {
|
||||||
rtp_session->last_time = switch_time_now();
|
rtp_session->last_time = switch_time_now();
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,6 +139,15 @@ SWITCH_DECLARE(void) switch_time_sync(void)
|
||||||
SWITCH_DECLARE(void) switch_sleep(switch_interval_time_t t)
|
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)
|
#if defined(HAVE_CLOCK_NANOSLEEP) && defined(SWITCH_USE_CLOCK_FUNCS)
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
ts.tv_sec = t / APR_USEC_PER_SEC;
|
ts.tv_sec = t / APR_USEC_PER_SEC;
|
||||||
|
@ -153,7 +162,7 @@ SWITCH_DECLARE(void) switch_sleep(switch_interval_time_t t)
|
||||||
#else
|
#else
|
||||||
apr_sleep(t);
|
apr_sleep(t);
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue