add extra sanity check
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11203 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
a45b1684ac
commit
0d5705d396
|
@ -572,7 +572,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
|
||||||
switch_assert(session != NULL);
|
switch_assert(session != NULL);
|
||||||
switch_assert(frame != NULL);
|
switch_assert(frame != NULL);
|
||||||
|
|
||||||
if (switch_channel_get_state(session->channel) >= CS_HANGUP) {
|
if (!switch_channel_ready(session->channel)) {
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -605,7 +605,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
|
||||||
|
|
||||||
switch_mutex_lock(session->codec_write_mutex);
|
switch_mutex_lock(session->codec_write_mutex);
|
||||||
|
|
||||||
if (!(session->write_codec && session->write_codec->mutex && frame->codec)) {
|
if (!(session->write_codec && session->write_codec->mutex && frame->codec) ||
|
||||||
|
!switch_channel_ready(session->channel) || !switch_channel_media_ready(session->channel)) {
|
||||||
switch_mutex_unlock(session->codec_write_mutex);
|
switch_mutex_unlock(session->codec_write_mutex);
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue