diff mbox series

[FFmpeg-devel,2/5] avcodec/librav1e: use AVCodecContext.get_encode_buffer()

Message ID 20210313001538.7240-3-jamrial@gmail.com
State New
Headers show
Series Initial usage of AVCodecContext.get_encode_buffer() | expand

Checks

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

Commit Message

James Almer March 13, 2021, 12:15 a.m. UTC
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/librav1e.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/librav1e.c b/libavcodec/librav1e.c
index 2d5acc7d8e..276fb1b039 100644
--- a/libavcodec/librav1e.c
+++ b/libavcodec/librav1e.c
@@ -532,7 +532,7 @@  retry:
         return AVERROR_UNKNOWN;
     }
 
-    ret = av_new_packet(pkt, rpkt->len);
+    ret = ff_get_encode_buffer(avctx, pkt, rpkt->len, 0);
     if (ret < 0) {
         av_log(avctx, AV_LOG_ERROR, "Could not allocate packet.\n");
         rav1e_packet_unref(rpkt);
@@ -624,7 +624,8 @@  AVCodec ff_librav1e_encoder = {
     .priv_class     = &class,
     .defaults       = librav1e_defaults,
     .pix_fmts       = librav1e_pix_fmts,
-    .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AUTO_THREADS,
+    .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AUTO_THREADS |
+                      AV_CODEC_CAP_DR1,
     .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
     .wrapper_name   = "librav1e",
 };