diff mbox series

[FFmpeg-devel,27/34] avcodec/libcodec2: Avoid copying packet data

Message ID HE1PR0301MB2154562D3E577ED74386B3458F439@HE1PR0301MB2154.eurprd03.prod.outlook.com
State Superseded
Headers show
Series [FFmpeg-devel,01/34] avcodec/adpcmenc: Avoid copying packet data
Related show

Checks

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

Commit Message

Andreas Rheinhardt April 25, 2021, 10:34 p.m. UTC
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.rheinhardt@outlook.com>
---
 libavcodec/libcodec2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

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;
     }