PR #25995 opened by Baptiste Coudurier (bcoudurier)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25995
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25995.patch

qtrle has no frame type in the bitstream, so its frames came out with neither 
`AV_FRAME_FLAG_KEY` nor `pict_type`, and players that wait for a keyframe (e.g. 
Kodi) showed nothing. Take them from the packet's key flag (mov sync samples), 
as zerocodec and pdv do.

`Animation-16Greys.mov` now gives 12 `I` key frames and 26 `P` frames, matching 
its packet flags. qtrle FATE tests pass.

Fixes #25939.

🤖 Generated with [Claude Code](https://claude.com/claude-code)



From 9f58d51575c5785689af99d7f71574222bc4c6f0 Mon Sep 17 00:00:00 2001
From: Baptiste Coudurier <[email protected]>
Date: Thu, 12 Nov 2026 13:37:48 -0800
Subject: [PATCH] avcodec/qtrle: set frame key flag and pict_type from the
 packet

The bitstream has no frame type; use the container's sync samples.

Fixes #25939.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Baptiste Coudurier <[email protected]>
---
 libavcodec/qtrle.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libavcodec/qtrle.c b/libavcodec/qtrle.c
index 1c2fbc357e2..e89fef031f8 100644
--- a/libavcodec/qtrle.c
+++ b/libavcodec/qtrle.c
@@ -557,6 +557,15 @@ done:
 
     if ((ret = av_frame_ref(rframe, s->frame)) < 0)
         return ret;
+
+    /* The bitstream has no frame type, so trust the container's sync samples. 
*/
+    if (avpkt->flags & AV_PKT_FLAG_KEY) {
+        rframe->flags    |= AV_FRAME_FLAG_KEY;
+        rframe->pict_type = AV_PICTURE_TYPE_I;
+    } else {
+        rframe->flags    &= ~AV_FRAME_FLAG_KEY;
+        rframe->pict_type = AV_PICTURE_TYPE_P;
+    }
     *got_frame      = 1;
 
     /* always report that the buffer was completely consumed */
-- 
2.54.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to