[FFmpeg-devel] [PATCH 3/5] avcodec/bitpacked_dec: setting pict_type and key_frame after decode()

lance.lmwang at gmail.com lance.lmwang at gmail.com
Wed Dec 1 15:39:12 EET 2021


From: Limin Wang <lance.lmwang at gmail.com>

Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
---
 libavcodec/bitpacked_dec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/bitpacked_dec.c b/libavcodec/bitpacked_dec.c
index c1cb6ac..a2edccc 100644
--- a/libavcodec/bitpacked_dec.c
+++ b/libavcodec/bitpacked_dec.c
@@ -129,13 +129,13 @@ static int bitpacked_decode(AVCodecContext *avctx, void *data, int *got_frame,
     AVFrame *frame = data;
     int res;
 
-    frame->pict_type = AV_PICTURE_TYPE_I;
-    frame->key_frame = 1;
-
     res = bc->decode(avctx, frame, avpkt);
     if (res)
         return res;
 
+    frame->pict_type = AV_PICTURE_TYPE_I;
+    frame->key_frame = 1;
+
     *got_frame = 1;
     return buf_size;
 
-- 
1.8.3.1



More information about the ffmpeg-devel mailing list