diff options
author | James Almer <jamrial@gmail.com> | 2023-01-23 19:05:02 -0300 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2023-02-09 15:24:16 +0100 |
commit | e0786a8eeb9e7c8feb057e83f284491f0a87e463 (patch) | |
tree | cfaa0daf5762ab3ccfb8e6c109e970adb32a9436 /libavcodec/frame_thread_encoder.c | |
parent | 2f9cd8861797df5b4d2e36143dfa8268b65cfd38 (diff) | |
download | ffmpeg-e0786a8eeb9e7c8feb057e83f284491f0a87e463.tar.gz |
avcodec: remove FF_API_THREAD_SAFE_CALLBACKS
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/frame_thread_encoder.c')
-rw-r--r-- | libavcodec/frame_thread_encoder.c | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/libavcodec/frame_thread_encoder.c b/libavcodec/frame_thread_encoder.c index 35775ae823..62d9580ad4 100644 --- a/libavcodec/frame_thread_encoder.c +++ b/libavcodec/frame_thread_encoder.c @@ -48,9 +48,6 @@ typedef struct{ typedef struct{ AVCodecContext *parent_avctx; -#if FF_API_THREAD_SAFE_CALLBACKS - pthread_mutex_t buffer_mutex; -#endif pthread_mutex_t task_fifo_mutex; /* Used to guard (next_)task_index */ pthread_cond_t task_fifo_cond; @@ -70,15 +67,9 @@ typedef struct{ } ThreadContext; #define OFF(member) offsetof(ThreadContext, member) -#if FF_API_THREAD_SAFE_CALLBACKS -DEFINE_OFFSET_ARRAY(ThreadContext, thread_ctx, pthread_init_cnt, - (OFF(buffer_mutex), OFF(task_fifo_mutex), OFF(finished_task_mutex)), - (OFF(task_fifo_cond), OFF(finished_task_cond))); -#else DEFINE_OFFSET_ARRAY(ThreadContext, thread_ctx, pthread_init_cnt, (OFF(task_fifo_mutex), OFF(finished_task_mutex)), (OFF(task_fifo_cond), OFF(finished_task_cond))); -#endif #undef OFF static void * attribute_align_arg worker(void *v){ @@ -112,11 +103,6 @@ static void * attribute_align_arg worker(void *v){ pkt = task->outdata; ret = ff_encode_encode_cb(avctx, pkt, frame, &task->got_packet); -#if FF_API_THREAD_SAFE_CALLBACKS - pthread_mutex_lock(&c->buffer_mutex); - av_frame_unref(frame); - pthread_mutex_unlock(&c->buffer_mutex); -#endif pthread_mutex_lock(&c->finished_task_mutex); task->return_code = ret; task->finished = 1; @@ -124,13 +110,7 @@ static void * attribute_align_arg worker(void *v){ pthread_mutex_unlock(&c->finished_task_mutex); } end: -#if FF_API_THREAD_SAFE_CALLBACKS - pthread_mutex_lock(&c->buffer_mutex); -#endif avcodec_close(avctx); -#if FF_API_THREAD_SAFE_CALLBACKS - pthread_mutex_unlock(&c->buffer_mutex); -#endif av_freep(&avctx); return NULL; } |