提交 81e47636 authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-10454: [mod_av] Regression in video file seek #resolve

上级 a2e14fc6
...@@ -1570,9 +1570,18 @@ static void *SWITCH_THREAD_FUNC file_read_thread_run(switch_thread_t *thread, vo ...@@ -1570,9 +1570,18 @@ static void *SWITCH_THREAD_FUNC file_read_thread_run(switch_thread_t *thread, vo
context->seek_ts = -2; context->seek_ts = -2;
if (context->has_video) { if (context->has_video) {
void *pop;
context->video_st.next_pts = 0; context->video_st.next_pts = 0;
context->video_start_time = 0; context->video_start_time = 0;
avcodec_flush_buffers(context->video_st.st->codec); avcodec_flush_buffers(context->video_st.st->codec);
while(switch_queue_trypop(context->eh.video_queue, &pop) == SWITCH_STATUS_SUCCESS) {
switch_image_t *img;
if (!pop) break;
img = (switch_image_t *) pop;
switch_img_free(&img);
}
} }
} }
...@@ -2428,7 +2437,7 @@ static switch_status_t av_file_read_video(switch_file_handle_t *handle, switch_f ...@@ -2428,7 +2437,7 @@ static switch_status_t av_file_read_video(switch_file_handle_t *handle, switch_f
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
if (context->read_paused) { if (context->read_paused || context->seek_ts == -2) {
int sanity = 10; int sanity = 10;
if (context->seek_ts == -2) { // just seeked, try read a new img if (context->seek_ts == -2) { // just seeked, try read a new img
...@@ -2597,8 +2606,13 @@ static switch_status_t av_file_read_video(switch_file_handle_t *handle, switch_f ...@@ -2597,8 +2606,13 @@ static switch_status_t av_file_read_video(switch_file_handle_t *handle, switch_f
} }
context->vid_ready = 1; context->vid_ready = 1;
} }
if (!frame->img) context->closed = 1;
return frame->img ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE; if ((flags & SVR_BLOCK)) {
if (!frame->img) context->closed = 1;
return frame->img ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
} else {
return frame->img ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_BREAK;
}
} }
#endif #endif
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论