diff mbox series

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

Message ID 20210313001538.7240-4-jamrial@gmail.com
State Accepted
Commit b86af93cea705d32c9b393ea671d623bb343eb91
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/mfenc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/mfenc.c b/libavcodec/mfenc.c
index 7fdc7af330..d70e49351a 100644
--- a/libavcodec/mfenc.c
+++ b/libavcodec/mfenc.c
@@ -243,7 +243,7 @@  static int mf_sample_to_avpacket(AVCodecContext *avctx, IMFSample *sample, AVPac
     if (FAILED(hr))
         return AVERROR_EXTERNAL;
 
-    if ((ret = av_new_packet(avpkt, len)) < 0)
+    if ((ret = ff_get_encode_buffer(avctx, avpkt, len, 0)) < 0)
         return ret;
 
     IMFSample_ConvertToContiguousBuffer(sample, &buffer);
@@ -1163,7 +1163,8 @@  static int mf_close(AVCodecContext *avctx)
         .close          = mf_close,                                            \
         .receive_packet = mf_receive_packet,                                   \
         EXTRA                                                                  \
-        .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID,            \
+        .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID |           \
+                          AV_CODEC_CAP_DR1,                                    \
         .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE |                       \
                           FF_CODEC_CAP_INIT_CLEANUP,                           \
     };