提交 3fbb709e authored 作者: Anthony Minessale's avatar Anthony Minessale

update

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8006 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 7346263d
...@@ -398,7 +398,8 @@ typedef enum { ...@@ -398,7 +398,8 @@ typedef enum {
SWITCH_RTP_FLAG_AUTO_CNG = (1 << 15), SWITCH_RTP_FLAG_AUTO_CNG = (1 << 15),
SWITCH_RTP_FLAG_SECURE_SEND_RESET = (1 << 16), SWITCH_RTP_FLAG_SECURE_SEND_RESET = (1 << 16),
SWITCH_RTP_FLAG_SECURE_RECV_RESET = (1 << 17), SWITCH_RTP_FLAG_SECURE_RECV_RESET = (1 << 17),
SWITCH_RTP_FLAG_PROXY_MEDIA = (1 << 18) SWITCH_RTP_FLAG_PROXY_MEDIA = (1 << 18),
SWITCH_RTP_FLAG_SHUTDOWN = (1 << 19)
} switch_rtp_flag_t; } switch_rtp_flag_t;
......
...@@ -862,13 +862,12 @@ SWITCH_DECLARE(uint8_t) switch_rtp_ready(switch_rtp_t *rtp_session) ...@@ -862,13 +862,12 @@ SWITCH_DECLARE(uint8_t) switch_rtp_ready(switch_rtp_t *rtp_session)
{ {
uint8_t ret; uint8_t ret;
if (!rtp_session || !rtp_session->flag_mutex) { if (!rtp_session || !rtp_session->flag_mutex || switch_test_flag(rtp_session, SWITCH_RTP_FLAG_SHUTDOWN)) {
return 0; return 0;
} }
switch_mutex_lock(rtp_session->flag_mutex); switch_mutex_lock(rtp_session->flag_mutex);
ret = (rtp_session != NULL && ret = (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_IO) && rtp_session->sock && rtp_session->remote_addr && rtp_session->ready == 2) ? 1 : 0;
switch_test_flag(rtp_session, SWITCH_RTP_FLAG_IO) && rtp_session->sock && rtp_session->remote_addr && rtp_session->ready == 2) ? 1 : 0;
switch_mutex_unlock(rtp_session->flag_mutex); switch_mutex_unlock(rtp_session->flag_mutex);
return ret; return ret;
...@@ -883,7 +882,7 @@ SWITCH_DECLARE(void) switch_rtp_destroy(switch_rtp_t **rtp_session) ...@@ -883,7 +882,7 @@ SWITCH_DECLARE(void) switch_rtp_destroy(switch_rtp_t **rtp_session)
return; return;
} }
switch_mutex_lock((*rtp_session)->flag_mutex); switch_set_flag_locked((*rtp_session), SWITCH_RTP_FLAG_SHUTDOWN);
READ_INC((*rtp_session)); READ_INC((*rtp_session));
WRITE_INC((*rtp_session)); WRITE_INC((*rtp_session));
...@@ -893,6 +892,7 @@ SWITCH_DECLARE(void) switch_rtp_destroy(switch_rtp_t **rtp_session) ...@@ -893,6 +892,7 @@ SWITCH_DECLARE(void) switch_rtp_destroy(switch_rtp_t **rtp_session)
READ_DEC((*rtp_session)); READ_DEC((*rtp_session));
WRITE_DEC((*rtp_session)); WRITE_DEC((*rtp_session));
switch_mutex_lock((*rtp_session)->flag_mutex);
switch_rtp_kill_socket(*rtp_session); switch_rtp_kill_socket(*rtp_session);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论