| 977 | } |
| 978 | |
| 979 | av_cold void ff_thread_flush(AVCodecContext *avctx) |
| 980 | { |
| 981 | int i; |
| 982 | FrameThreadContext *fctx = avctx->internal->thread_ctx; |
| 983 | |
| 984 | if (!fctx) return; |
| 985 | |
| 986 | park_frame_worker_threads(fctx, avctx->thread_count); |
| 987 | if (fctx->prev_thread) { |
| 988 | if (fctx->prev_thread != &fctx->threads[0]) |
| 989 | update_context_from_thread(fctx->threads[0].avctx, fctx->prev_thread->avctx, 0); |
| 990 | } |
| 991 | |
| 992 | fctx->next_decoding = fctx->next_finished = 0; |
| 993 | fctx->prev_thread = NULL; |
| 994 | |
| 995 | decoded_frames_flush(&fctx->df); |
| 996 | fctx->result = 0; |
| 997 | |
| 998 | for (i = 0; i < avctx->thread_count; i++) { |
| 999 | PerThreadContext *p = &fctx->threads[i]; |
| 1000 | |
| 1001 | decoded_frames_flush(&p->df); |
| 1002 | p->result = 0; |
| 1003 | |
| 1004 | avcodec_flush_buffers(p->avctx); |
| 1005 | } |
| 1006 | } |
| 1007 | |
| 1008 | int ff_thread_can_start_frame(AVCodecContext *avctx) |
| 1009 | { |
no test coverage detected