mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-13 07:45:26 +00:00
fix possible issue with double read of frames in conf
This commit is contained in:
parent
d7608fad7a
commit
b513d1ff02
@ -1459,6 +1459,7 @@ static switch_status_t conference_add_member(conference_obj_t *conference, confe
|
||||
if (switch_channel_test_flag(channel, CF_VIDEO)) {
|
||||
if (switch_test_flag(conference, CFLAG_VIDEO_BRIDGE)) {
|
||||
switch_channel_set_flag(channel, CF_VIDEO_ECHO);
|
||||
switch_channel_clear_flag(channel, CF_VIDEO_PASSIVE);
|
||||
} else {
|
||||
switch_channel_clear_flag(channel, CF_VIDEO_ECHO);
|
||||
}
|
||||
@ -1618,7 +1619,7 @@ static void conference_set_video_floor_holder(conference_obj_t *conference, conf
|
||||
if (member) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "Adding video floor %s\n",
|
||||
switch_channel_get_name(member->channel));
|
||||
switch_channel_set_flag(member->channel, CF_VIDEO_PASSIVE);
|
||||
//switch_channel_set_flag(member->channel, CF_VIDEO_PASSIVE);
|
||||
switch_core_session_refresh_video(member->session);
|
||||
conference->video_floor_holder = member;
|
||||
} else {
|
||||
@ -1627,7 +1628,7 @@ static void conference_set_video_floor_holder(conference_obj_t *conference, conf
|
||||
|
||||
if (old_member) {
|
||||
old_id = old_member->id;
|
||||
switch_channel_clear_flag(old_member->channel, CF_VIDEO_PASSIVE);
|
||||
//switch_channel_clear_flag(old_member->channel, CF_VIDEO_PASSIVE);
|
||||
}
|
||||
|
||||
switch_set_flag(conference, CFLAG_FLOOR_CHANGE);
|
||||
@ -7488,6 +7489,7 @@ SWITCH_STANDARD_APP(conference_function)
|
||||
switch_core_session_video_reset(session);
|
||||
|
||||
switch_channel_set_flag(channel, CF_CONFERENCE);
|
||||
switch_channel_set_flag(channel, CF_VIDEO_PASSIVE);
|
||||
|
||||
if (switch_channel_answer(channel) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Channel answer failed.\n");
|
||||
@ -8042,6 +8044,7 @@ SWITCH_STANDARD_APP(conference_function)
|
||||
end:
|
||||
|
||||
switch_channel_clear_flag(channel, CF_CONFERENCE);
|
||||
switch_channel_clear_flag(channel, CF_VIDEO_PASSIVE);
|
||||
|
||||
switch_core_session_video_reset(session);
|
||||
}
|
||||
|
@ -229,6 +229,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
|
||||
}
|
||||
}
|
||||
|
||||
if (status == SWITCH_STATUS_INUSE) {
|
||||
*frame = &runtime.dummy_cng_frame;
|
||||
switch_yield(20000);
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
if (!SWITCH_READ_ACCEPTABLE(status) || !session->read_codec || !switch_core_codec_ready(session->read_codec)) {
|
||||
*frame = NULL;
|
||||
return SWITCH_STATUS_FALSE;
|
||||
|
@ -1231,14 +1231,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_read_frame(switch_core_session
|
||||
|
||||
if (switch_mutex_trylock(engine->read_mutex) != SWITCH_STATUS_SUCCESS) {
|
||||
/* return CNG, another thread is already reading */
|
||||
*frame = &engine->read_frame;
|
||||
switch_set_flag((*frame), SFF_CNG);
|
||||
(*frame)->datalen = engine->read_impl.encoded_bytes_per_packet;
|
||||
memset((*frame)->data, 0, (*frame)->datalen);
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG1, "%s is already being read for %s\n",
|
||||
switch_channel_get_name(session->channel), type2str(type));
|
||||
switch_yield(10000);
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
return SWITCH_STATUS_INUSE;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user