diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-02-07 10:48:17 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-02-16 22:11:53 +0100 |
commit | e0f5086fabe6feef362b9398a41ef30de07a08ee (patch) | |
tree | b22d97ad6913c430a1ce8fac37997c6c6c1c3c22 /libavcodec | |
parent | 44cf3a2b16324c2a04545a6b7304acd77e5cf24a (diff) | |
download | ffmpeg-e0f5086fabe6feef362b9398a41ef30de07a08ee.tar.gz |
avcodec/frame_thread_encoder: Improve type safety
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/frame_thread_encoder.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/libavcodec/frame_thread_encoder.c b/libavcodec/frame_thread_encoder.c index 83229f620a..ee289c90e3 100644 --- a/libavcodec/frame_thread_encoder.c +++ b/libavcodec/frame_thread_encoder.c @@ -35,8 +35,8 @@ #define BUFFER_SIZE (2*MAX_THREADS) typedef struct{ - void *indata; - void *outdata; + AVFrame *indata; + AVPacket *outdata; int64_t return_code; unsigned index; } Task; @@ -255,19 +255,12 @@ void ff_frame_thread_encoder_free(AVCodecContext *avctx){ while (av_fifo_size(c->task_fifo) > 0) { Task task; - AVFrame *frame; av_fifo_generic_read(c->task_fifo, &task, sizeof(task), NULL); - frame = task.indata; - av_frame_free(&frame); - task.indata = NULL; + av_frame_free(&task.indata); } for (i=0; i<BUFFER_SIZE; i++) { - if (c->finished_tasks[i].outdata != NULL) { - AVPacket *pkt = c->finished_tasks[i].outdata; - av_packet_free(&pkt); - c->finished_tasks[i].outdata = NULL; - } + av_packet_free(&c->finished_tasks[i].outdata); } pthread_mutex_destroy(&c->task_fifo_mutex); |