提交 224f4c0f authored 作者: Anthony Minessale's avatar Anthony Minessale

fix packet storm of vid refresh in edge case

上级 8802260a
...@@ -1230,7 +1230,6 @@ static void *SWITCH_THREAD_FUNC conference_video_thread_run(switch_thread_t *thr ...@@ -1230,7 +1230,6 @@ static void *SWITCH_THREAD_FUNC conference_video_thread_run(switch_thread_t *thr
int yield = 0; int yield = 0;
uint32_t last_member = 0; uint32_t last_member = 0;
switch_core_session_t *session; switch_core_session_t *session;
switch_channel_t *channel;
switch_core_session_message_t msg = { 0 }; switch_core_session_message_t msg = { 0 };
conference->video_running = 1; conference->video_running = 1;
...@@ -1258,7 +1257,6 @@ static void *SWITCH_THREAD_FUNC conference_video_thread_run(switch_thread_t *thr ...@@ -1258,7 +1257,6 @@ static void *SWITCH_THREAD_FUNC conference_video_thread_run(switch_thread_t *thr
goto do_continue; goto do_continue;
} }
channel = NULL;
session = conference->floor_holder->session; session = conference->floor_holder->session;
switch_core_session_read_lock(session); switch_core_session_read_lock(session);
switch_mutex_unlock(conference->member_mutex); switch_mutex_unlock(conference->member_mutex);
...@@ -1271,8 +1269,6 @@ static void *SWITCH_THREAD_FUNC conference_video_thread_run(switch_thread_t *thr ...@@ -1271,8 +1269,6 @@ static void *SWITCH_THREAD_FUNC conference_video_thread_run(switch_thread_t *thr
goto do_continue; goto do_continue;
} }
channel = switch_core_session_get_channel(session);
if (conference->floor_holder->id != last_member) { if (conference->floor_holder->id != last_member) {
int iframe = 0; int iframe = 0;
...@@ -1315,17 +1311,10 @@ static void *SWITCH_THREAD_FUNC conference_video_thread_run(switch_thread_t *thr ...@@ -1315,17 +1311,10 @@ static void *SWITCH_THREAD_FUNC conference_video_thread_run(switch_thread_t *thr
if (imember->session && switch_channel_test_flag(ichannel, CF_VIDEO)) { if (imember->session && switch_channel_test_flag(ichannel, CF_VIDEO)) {
has_vid++; has_vid++;
if (switch_channel_test_flag(channel, CF_VIDEO_REFRESH_REQ)) {
switch_core_session_receive_message(imember->session, &msg);
}
switch_core_session_write_video_frame(imember->session, vid_frame, SWITCH_IO_FLAG_NONE, 0); switch_core_session_write_video_frame(imember->session, vid_frame, SWITCH_IO_FLAG_NONE, 0);
} }
} }
if (switch_channel_test_flag(channel, CF_VIDEO_REFRESH_REQ)) {
switch_channel_clear_flag(channel, CF_VIDEO_REFRESH_REQ);
}
if (want_refresh) { if (want_refresh) {
switch_core_session_receive_message(session, &msg); switch_core_session_receive_message(session, &msg);
want_refresh = 0; want_refresh = 0;
......
...@@ -7137,11 +7137,13 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t ...@@ -7137,11 +7137,13 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t
if (!strncasecmp(sip->sip_content_type->c_type, "application", 11) && !strcasecmp(sip->sip_content_type->c_subtype, "media_control+xml")) { if (!strncasecmp(sip->sip_content_type->c_type, "application", 11) && !strcasecmp(sip->sip_content_type->c_subtype, "media_control+xml")) {
switch_core_session_t *other_session; switch_core_session_t *other_session;
switch_channel_set_flag(channel, CF_VIDEO_REFRESH_REQ); if (switch_channel_test_flag(channel, CF_VIDEO)) {
if (switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) {
if (switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) { sofia_glue_build_vid_refresh_message(other_session, sip->sip_payload->pl_data);
sofia_glue_build_vid_refresh_message(other_session, sip->sip_payload->pl_data); switch_core_session_rwunlock(other_session);
switch_core_session_rwunlock(other_session); } else {
switch_channel_set_flag(channel, CF_VIDEO_REFRESH_REQ);
}
} }
} else if (!strncasecmp(sip->sip_content_type->c_type, "application", 11) && !strcasecmp(sip->sip_content_type->c_subtype, "dtmf-relay")) { } else if (!strncasecmp(sip->sip_content_type->c_type, "application", 11) && !strcasecmp(sip->sip_content_type->c_subtype, "dtmf-relay")) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论