[FFmpeg-devel] [PATCH] avcodec/qtrle: set pict type information in ouptut frames

James Almer jamrial at gmail.com
Thu Aug 29 19:00:33 EEST 2019


Signed-off-by: James Almer <jamrial at gmail.com>
---
 libavcodec/qtrle.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavcodec/qtrle.c b/libavcodec/qtrle.c
index f565e0e358..ba6740f5d4 100644
--- a/libavcodec/qtrle.c
+++ b/libavcodec/qtrle.c
@@ -449,6 +449,7 @@ static int qtrle_decode_frame(AVCodecContext *avctx,
                               AVPacket *avpkt)
 {
     QtrleContext *s = avctx->priv_data;
+    AVFrame *frame = data;
     int header, start_line;
     int height, row_ptr;
     int has_palette = 0;
@@ -566,6 +567,12 @@ done:
 
     if ((ret = av_frame_ref(data, s->frame)) < 0)
         return ret;
+    if (avpkt->flags & AV_PKT_FLAG_KEY) {
+        frame->pict_type = AV_PICTURE_TYPE_I;
+        frame->key_frame = 1;
+    } else {
+        frame->pict_type = AV_PICTURE_TYPE_P;
+    }
     *got_frame      = 1;
 
     /* always report that the buffer was completely consumed */
-- 
2.22.0



More information about the ffmpeg-devel mailing list