提交 2f8a6db0 authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-9704: [mod_av] Seeking video files with mod_av after it reaches the end does…

FS-9704: [mod_av] Seeking video files with mod_av after it reaches the end does not work fix regression
上级 6cfb94b8
......@@ -2052,9 +2052,13 @@ static switch_status_t av_file_close(switch_file_handle_t *handle)
av_file_write(handle, NULL, NULL);
}
if (context->file_read_thread_running && context->file_read_thread) {
if (context->file_read_thread_running) {
context->file_read_thread_running = 0;
}
if (context->file_read_thread) {
switch_thread_join(&status, context->file_read_thread);
context->file_read_thread = NULL;
}
if (context->eh.video_queue) {
......@@ -2093,6 +2097,12 @@ static switch_status_t av_file_seek(switch_file_handle_t *handle, unsigned int *
if (!context->file_read_thread_running) {
switch_threadattr_t *thd_attr = NULL;
if (context->file_read_thread) {
switch_status_t status;
switch_thread_join(&status, context->file_read_thread);
context->file_read_thread = NULL;
}
switch_threadattr_create(&thd_attr, handle->memory_pool);
switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
switch_thread_create(&context->file_read_thread, thd_attr, file_read_thread_run, context, handle->memory_pool);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论