mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-06-27 11:47:41 +00:00
FS-10019 revert and alternate fix
This commit is contained in:
parent
13bf24bd10
commit
a8c23ed87c
@ -423,7 +423,7 @@ switch_status_t conference_close_open_files(conference_obj_t *conference)
|
||||
{
|
||||
int x = 0;
|
||||
|
||||
switch_mutex_lock(conference->mutex);
|
||||
switch_mutex_lock(conference->file_mutex);
|
||||
/* Close Unused Handles */
|
||||
if (conference->fnode) {
|
||||
conference_file_node_t *fnode, *cur;
|
||||
@ -453,7 +453,7 @@ switch_status_t conference_close_open_files(conference_obj_t *conference)
|
||||
switch_core_destroy_memory_pool(&pool);
|
||||
x++;
|
||||
}
|
||||
switch_mutex_unlock(conference->mutex);
|
||||
switch_mutex_unlock(conference->file_mutex);
|
||||
|
||||
return x ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
@ -2344,7 +2344,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
|
||||
|
||||
video_count = 0;
|
||||
|
||||
switch_mutex_lock(conference->mutex);
|
||||
switch_mutex_lock(conference->file_mutex);
|
||||
if (conference->async_fnode && switch_core_file_has_video(&conference->async_fnode->fh, SWITCH_TRUE)) {
|
||||
check_async_file = 1;
|
||||
file_count++;
|
||||
@ -2358,7 +2358,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
|
||||
video_count++;
|
||||
files_playing = 1;
|
||||
}
|
||||
switch_mutex_unlock(conference->mutex);
|
||||
switch_mutex_unlock(conference->file_mutex);
|
||||
|
||||
switch_mutex_lock(conference->member_mutex);
|
||||
for (imember = conference->members; imember; imember = imember->next) {
|
||||
@ -2791,8 +2791,9 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
|
||||
layout_applied = 0;
|
||||
}
|
||||
|
||||
switch_mutex_lock(conference->mutex);
|
||||
|
||||
|
||||
switch_mutex_lock(conference->file_mutex);
|
||||
|
||||
if (check_async_file && conference->async_fnode) {
|
||||
switch_status_t st = switch_core_file_read_video(&conference->async_fnode->fh, &file_frame, SVR_FLUSH);
|
||||
|
||||
@ -2818,7 +2819,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
|
||||
j++;
|
||||
}
|
||||
}
|
||||
switch_mutex_unlock(conference->mutex);
|
||||
switch_mutex_unlock(conference->file_mutex);
|
||||
|
||||
for (imember = conference->members; imember; imember = imember->next) {
|
||||
int i = 0;
|
||||
|
@ -663,16 +663,19 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob
|
||||
conference_video_canvas_del_fnode_layer(conference, conference->async_fnode);
|
||||
}
|
||||
|
||||
switch_mutex_lock(conference->file_mutex);
|
||||
conference_file_close(conference, conference->async_fnode);
|
||||
pool = conference->async_fnode->pool;
|
||||
conference->async_fnode = NULL;
|
||||
switch_core_destroy_memory_pool(&pool);
|
||||
switch_mutex_unlock(conference->file_mutex);
|
||||
}
|
||||
|
||||
if (conference->fnode && conference->fnode->done) {
|
||||
conference_file_node_t *fnode;
|
||||
switch_memory_pool_t *pool;
|
||||
|
||||
switch_mutex_lock(conference->file_mutex);
|
||||
if (conference->fnode->type != NODE_TYPE_SPEECH) {
|
||||
conference_file_close(conference, conference->fnode);
|
||||
}
|
||||
@ -681,6 +684,7 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob
|
||||
conference_video_canvas_del_fnode_layer(conference, conference->fnode);
|
||||
}
|
||||
|
||||
|
||||
fnode = conference->fnode;
|
||||
conference->fnode = conference->fnode->next;
|
||||
|
||||
@ -692,6 +696,7 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob
|
||||
pool = fnode->pool;
|
||||
fnode = NULL;
|
||||
switch_core_destroy_memory_pool(&pool);
|
||||
switch_mutex_unlock(conference->file_mutex);
|
||||
}
|
||||
|
||||
if (!conference->end_count && conference->endconference_time &&
|
||||
@ -785,37 +790,7 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob
|
||||
}
|
||||
}
|
||||
|
||||
switch_mutex_lock(conference->mutex);
|
||||
|
||||
/* Close Unused Handles */
|
||||
if (conference->fnode) {
|
||||
conference_file_node_t *fnode, *cur;
|
||||
switch_memory_pool_t *pool;
|
||||
|
||||
fnode = conference->fnode;
|
||||
while (fnode) {
|
||||
cur = fnode;
|
||||
fnode = fnode->next;
|
||||
|
||||
if (cur->type != NODE_TYPE_SPEECH) {
|
||||
conference_file_close(conference, cur);
|
||||
}
|
||||
|
||||
pool = cur->pool;
|
||||
switch_core_destroy_memory_pool(&pool);
|
||||
}
|
||||
conference->fnode = NULL;
|
||||
}
|
||||
|
||||
if (conference->async_fnode) {
|
||||
switch_memory_pool_t *pool;
|
||||
conference_file_close(conference, conference->async_fnode);
|
||||
pool = conference->async_fnode->pool;
|
||||
conference->async_fnode = NULL;
|
||||
switch_core_destroy_memory_pool(&pool);
|
||||
}
|
||||
|
||||
switch_mutex_unlock(conference->mutex);
|
||||
conference_close_open_files(conference);
|
||||
|
||||
/* Wait till everybody is out */
|
||||
conference_utils_clear_flag_locked(conference, CFLAG_RUNNING);
|
||||
@ -3247,6 +3222,7 @@ conference_obj_t *conference_new(char *name, conference_xml_cfg_t cfg, switch_co
|
||||
/* Activate the conference mutex for exclusivity */
|
||||
switch_mutex_init(&conference->mutex, SWITCH_MUTEX_NESTED, conference->pool);
|
||||
switch_mutex_init(&conference->flag_mutex, SWITCH_MUTEX_NESTED, conference->pool);
|
||||
switch_mutex_init(&conference->file_mutex, SWITCH_MUTEX_NESTED, conference->pool);
|
||||
switch_thread_rwlock_create(&conference->rwlock, conference->pool);
|
||||
switch_mutex_init(&conference->member_mutex, SWITCH_MUTEX_NESTED, conference->pool);
|
||||
switch_mutex_init(&conference->canvas_mutex, SWITCH_MUTEX_NESTED, conference->pool);
|
||||
|
@ -601,6 +601,7 @@ typedef struct conference_obj {
|
||||
member_flag_t mflags[MFLAG_MAX];
|
||||
switch_call_cause_t bridge_hangup_cause;
|
||||
switch_mutex_t *flag_mutex;
|
||||
switch_mutex_t *file_mutex;
|
||||
uint32_t rate;
|
||||
uint32_t interval;
|
||||
uint32_t channels;
|
||||
|
Loading…
x
Reference in New Issue
Block a user