| 1050 | } |
| 1051 | |
| 1052 | int ff_thread_get_ext_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags) |
| 1053 | { |
| 1054 | int ret; |
| 1055 | |
| 1056 | f->owner[0] = f->owner[1] = avctx; |
| 1057 | if (!(avctx->active_thread_type & FF_THREAD_FRAME)) |
| 1058 | return ff_get_buffer(avctx, f->f, flags); |
| 1059 | |
| 1060 | f->progress = av_refstruct_allocz(sizeof(*f->progress)); |
| 1061 | if (!f->progress) |
| 1062 | return AVERROR(ENOMEM); |
| 1063 | |
| 1064 | atomic_init(&f->progress->progress[0], -1); |
| 1065 | atomic_init(&f->progress->progress[1], -1); |
| 1066 | |
| 1067 | ret = ff_thread_get_buffer(avctx, f->f, flags); |
| 1068 | if (ret) |
| 1069 | av_refstruct_unref(&f->progress); |
| 1070 | return ret; |
| 1071 | } |
| 1072 | |
| 1073 | void ff_thread_release_ext_buffer(ThreadFrame *f) |
| 1074 | { |
nothing calls this directly
no test coverage detected