[FFmpeg-devel] [PATCH 1/8] avcodec/frame_thread_encoder: Improve type safety
Andreas Rheinhardt
andreas.rheinhardt at gmail.com
Mon Feb 8 14:23:23 EET 2021
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
libavcodec/frame_thread_encoder.c | 15 ++++-----------
1 file 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);
--
2.27.0
More information about the ffmpeg-devel
mailing list