When the packet size is known in advance like here, one can avoid
an intermediate buffer for the packet data.

Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com>
---
 libavcodec/dvenc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/dvenc.c b/libavcodec/dvenc.c
index e0679c538c..337bc326ef 100644
--- a/libavcodec/dvenc.c
+++ b/libavcodec/dvenc.c
@@ -1164,7 +1164,8 @@ static int dvvideo_encode_frame(AVCodecContext *c, 
AVPacket *pkt,
     DVVideoContext *s = c->priv_data;
     int ret;
 
-    if ((ret = ff_alloc_packet2(c, pkt, s->sys->frame_size, 0)) < 0)
+    if ((ret = ff_alloc_packet2(c, pkt, s->sys->frame_size,
+                                        s->sys->frame_size)) < 0)
         return ret;
 
     c->pix_fmt                = s->sys->pix_fmt;
-- 
2.27.0

_______________________________________________
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