ff_alloc_packet2 should be used if encode2 API

Signed-off-by: Jing Sun <jing.a....@intel.com>
---
 libavcodec/vaapi_encode.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index 2dda451..98e3176 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -26,6 +26,7 @@
 
 #include "vaapi_encode.h"
 #include "avcodec.h"
+#include "internal.h"
 
 static const char * const picture_type_name[] = { "IDR", "I", "P", "B" };
 
@@ -509,7 +510,7 @@ static int vaapi_encode_output(AVCodecContext *avctx,
         av_log(avctx, AV_LOG_DEBUG, "Output buffer: %u bytes "
                "(status %08x).\n", buf->size, buf->status);
 
-        err = av_new_packet(pkt, buf->size);
+        err = ff_alloc_packet2(avctx, pkt, buf->size, 0);
         if (err < 0)
             goto fail_mapped;
 
-- 
1.8.3.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to