提交 f6427a5f authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-8382 #resolve [Segfault with inbound-proxy-media enabled]

上级 8f93fd55
......@@ -8662,7 +8662,7 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
switch_core_media_choose_port(session, SWITCH_MEDIA_TYPE_VIDEO, 1);
clear_pmaps(v_engine);
pmap = switch_core_media_add_payload_map(session,
SWITCH_MEDIA_TYPE_AUDIO,
SWITCH_MEDIA_TYPE_VIDEO,
"PROXY-VID",
NULL,
NULL,
......@@ -8675,11 +8675,15 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
v_engine->cur_payload_map = pmap;
switch_snprintf(vport_buf, sizeof(vport_buf), "%u", v_engine->adv_sdp_port);
if (switch_channel_media_ready(session->channel) && !switch_rtp_ready(v_engine->rtp_session)) {
switch_channel_set_flag(session->channel, CF_VIDEO_POSSIBLE);
switch_channel_set_flag(session->channel, CF_REINVITE);
switch_core_media_activate_rtp(session);
}
v_engine->codec_negotiated = 1;
switch_core_media_set_video_codec(session, SWITCH_FALSE);
}
strncpy(q, p, 8);
......
......@@ -77,28 +77,30 @@ static void video_bridge_thread(switch_core_session_t *session, void *obj)
switch_codec_t *b_codec = switch_core_session_get_video_write_codec(vh->session_b);
switch_file_handle_t *fh;
switch_assert(a_codec);
switch_assert(b_codec);
if (switch_channel_test_flag(channel, CF_VIDEO_REFRESH_REQ)) {
refresh_timer = refresh_cnt;
}
if (switch_channel_test_flag(channel, CF_VIDEO_DECODED_READ)) {
if (a_codec->implementation->impl_id == b_codec->implementation->impl_id && !switch_channel_test_flag(b_channel, CF_VIDEO_DECODED_READ)) {
if (set_decoded_read) {
switch_channel_clear_flag_recursive(channel, CF_VIDEO_DECODED_READ);
set_decoded_read = 0;
if (!switch_channel_test_flag(channel, CF_PROXY_MEDIA)) {
switch_assert(a_codec);
switch_assert(b_codec);
if (switch_channel_test_flag(channel, CF_VIDEO_DECODED_READ)) {
if (a_codec->implementation->impl_id == b_codec->implementation->impl_id && !switch_channel_test_flag(b_channel, CF_VIDEO_DECODED_READ)) {
if (set_decoded_read) {
switch_channel_clear_flag_recursive(channel, CF_VIDEO_DECODED_READ);
set_decoded_read = 0;
refresh_timer = refresh_cnt;
}
}
} else {
if (a_codec->implementation->impl_id != b_codec->implementation->impl_id ||
switch_channel_test_flag(b_channel, CF_VIDEO_DECODED_READ)) {
switch_channel_set_flag_recursive(channel, CF_VIDEO_DECODED_READ);
set_decoded_read = 1;
refresh_timer = refresh_cnt;
}
}
} else {
if (a_codec->implementation->impl_id != b_codec->implementation->impl_id ||
switch_channel_test_flag(b_channel, CF_VIDEO_DECODED_READ)) {
switch_channel_set_flag_recursive(channel, CF_VIDEO_DECODED_READ);
set_decoded_read = 1;
refresh_timer = refresh_cnt;
}
}
if (refresh_timer) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论