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

fix close file snafu

上级 ca49966f
......@@ -410,6 +410,45 @@ switch_status_t conference_file_local_play(conference_obj_t *conference, switch_
return status;
}
switch_status_t conference_close_open_files(conference_obj_t *conference)
{
int x = 0;
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);
x++;
}
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);
x++;
}
switch_mutex_unlock(conference->mutex);
return x ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
}
/* For Emacs:
* Local Variables:
* mode:c
......
......@@ -2681,6 +2681,8 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
}
}
conference_close_open_files(conference);
switch_core_timer_destroy(&canvas->timer);
conference_video_destroy_canvas(&canvas);
......
......@@ -860,7 +860,7 @@ void conference_member_add_file_data(conference_member_t *member, int16_t *data,
void conference_send_notify(conference_obj_t *conference, const char *status, const char *call_id, switch_bool_t final);
switch_status_t conference_file_close(conference_obj_t *conference, conference_file_node_t *node);
void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, void *obj);
switch_status_t conference_close_open_files(conference_obj_t *conference);
void conference_al_gen_arc(conference_obj_t *conference, switch_stream_handle_t *stream);
void conference_al_process(al_handle_t *al, void *data, switch_size_t datalen, int rate);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论