diff mbox series

[FFmpeg-devel,26/34] avcodec/libxavs: Avoid copying packet data

Message ID HE1PR0301MB2154FE6668FFECE9C609C2888F439@HE1PR0301MB2154.eurprd03.prod.outlook.com
State New
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>
---
ff_alloc_packet2() call (for the actual packets, not this end-of-stream
packet), yet the size known in advance is not exact.

 libavcodec/libxavs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/libxavs.c b/libavcodec/libxavs.c
index a83b93b836..6be3d02be8 100644
--- a/libavcodec/libxavs.c
+++ b/libavcodec/libxavs.c
@@ -150,7 +150,7 @@  static int XAVS_frame(AVCodecContext *avctx, AVPacket *pkt,
 
     if (!ret) {
         if (!frame && !(x4->end_of_stream)) {
-            if ((ret = ff_alloc_packet2(avctx, pkt, 4, 0)) < 0)
+            if ((ret = ff_alloc_packet2(avctx, pkt, 4, 4)) < 0)
                 return ret;
 
             pkt->data[0] = 0x0;