FS-7696
This commit is contained in:
parent
ccaf29254e
commit
19ace86b4f
|
@ -1506,6 +1506,21 @@ static switch_status_t av_file_truncate(switch_file_handle_t *handle, int64_t of
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void flush_video_queue(switch_queue_t *q)
|
||||||
|
{
|
||||||
|
void *pop;
|
||||||
|
|
||||||
|
if (switch_queue_size(q) == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (switch_queue_trypop(q, &pop) == SWITCH_STATUS_SUCCESS) {
|
||||||
|
switch_image_t *img = (switch_image_t *) pop;
|
||||||
|
switch_img_free(&img);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
static switch_status_t av_file_close(switch_file_handle_t *handle)
|
static switch_status_t av_file_close(switch_file_handle_t *handle)
|
||||||
{
|
{
|
||||||
av_file_context_t *context = (av_file_context_t *)handle->private_info;
|
av_file_context_t *context = (av_file_context_t *)handle->private_info;
|
||||||
|
@ -1524,6 +1539,10 @@ static switch_status_t av_file_close(switch_file_handle_t *handle)
|
||||||
switch_thread_join(&status, context->file_read_thread);
|
switch_thread_join(&status, context->file_read_thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (context->eh.video_queue) {
|
||||||
|
flush_video_queue(context->eh.video_queue);
|
||||||
|
}
|
||||||
|
|
||||||
if (context->fc) {
|
if (context->fc) {
|
||||||
if (switch_test_flag(handle, SWITCH_FILE_FLAG_WRITE)) av_write_trailer(context->fc);
|
if (switch_test_flag(handle, SWITCH_FILE_FLAG_WRITE)) av_write_trailer(context->fc);
|
||||||
|
|
||||||
|
@ -1884,7 +1903,6 @@ static switch_status_t av_file_set_string(switch_file_handle_t *handle, switch_a
|
||||||
if (context->fc) {
|
if (context->fc) {
|
||||||
const char *field = switch_parse_audio_col(col);
|
const char *field = switch_parse_audio_col(col);
|
||||||
|
|
||||||
printf("WTF [%s][%s]\n", field, string);
|
|
||||||
if (field) {
|
if (field) {
|
||||||
av_dict_set(&context->fc->metadata, field, string, 0);
|
av_dict_set(&context->fc->metadata, field, string, 0);
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
|
Loading…
Reference in New Issue