diff mbox series

[FFmpeg-devel,03/50] avcodec/frame_thread_encoder: remove av_init_packet() call

Message ID 20210204191005.48190-4-jamrial@gmail.com
State New
Headers show
Series deprecate av_init_packet() and sizeof(AVPacket) as part of the ABI | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

James Almer Feb. 4, 2021, 7:09 p.m. UTC
The packet was allocated with av_packet_alloc(), so it's redundant.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/frame_thread_encoder.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/frame_thread_encoder.c b/libavcodec/frame_thread_encoder.c
index 83229f620a..9ae9d72934 100644
--- a/libavcodec/frame_thread_encoder.c
+++ b/libavcodec/frame_thread_encoder.c
@@ -72,7 +72,6 @@  static void * attribute_align_arg worker(void *v){
 
         if(!pkt) pkt = av_packet_alloc();
         if(!pkt) continue;
-        av_init_packet(pkt);
 
         pthread_mutex_lock(&c->task_fifo_mutex);
         while (av_fifo_size(c->task_fifo) <= 0 || atomic_load(&c->exit)) {
@@ -107,7 +106,7 @@  static void * attribute_align_arg worker(void *v){
         pthread_mutex_unlock(&c->finished_task_mutex);
     }
 end:
-    av_free(pkt);
+    av_packet_free(&pkt);
     pthread_mutex_lock(&c->buffer_mutex);
     avcodec_close(avctx);
     pthread_mutex_unlock(&c->buffer_mutex);