提交 8315b954 authored 作者: Anthony Minessale's avatar Anthony Minessale

tweak

上级 957262fa
...@@ -666,18 +666,19 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess ...@@ -666,18 +666,19 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
return status; return status;
} }
switch_mutex_lock(session->codec_write_mutex);
if (!(frame->codec && frame->codec->implementation)) { if (!(frame->codec && frame->codec->implementation)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "%s has received a bad frame with no codec!\n", switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "%s has received a bad frame with no codec!\n",
switch_channel_get_name(session->channel)); switch_channel_get_name(session->channel));
switch_channel_hangup(session->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); switch_channel_hangup(session->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
switch_mutex_unlock(session->codec_write_mutex);
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
switch_assert(frame->codec != NULL); switch_assert(frame->codec != NULL);
switch_assert(frame->codec->implementation != NULL); switch_assert(frame->codec->implementation != NULL);
switch_mutex_lock(session->codec_write_mutex);
if (!(switch_core_codec_ready(session->write_codec) && frame->codec) || if (!(switch_core_codec_ready(session->write_codec) && frame->codec) ||
!switch_channel_ready(session->channel) || !switch_channel_media_ready(session->channel)) { !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);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论