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/libcodec2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/libcodec2.c b/libavcodec/libcodec2.c
index 2164f36051..eadf3285f7 100644
--- a/libavcodec/libcodec2.c
+++ b/libavcodec/libcodec2.c
@@ -169,7 +169,7 @@ static int libcodec2_encode(AVCodecContext *avctx, AVPacket 
*avpkt,
     LibCodec2Context *c2 = avctx->priv_data;
     int16_t *samples = (int16_t *)frame->data[0];
 
-    int ret = ff_alloc_packet2(avctx, avpkt, avctx->block_align, 0);
+    int ret = ff_alloc_packet2(avctx, avpkt, avctx->block_align, 
avctx->block_align);
     if (ret < 0) {
         return ret;
     }
-- 
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