This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 45714cee101dc2c8a093404e49a46278523e94f5
Author:     Ramiro Polla <[email protected]>
AuthorDate: Mon Oct 19 13:13:05 2026 +0200
Commit:     Ramiro Polla <[email protected]>
CommitDate: Wed Nov 4 00:35:02 2026 +0000

    avformat/webp_anim_dec: fix keyframe flag when seeking
    
    The keyframe flag was only being set when looping, and not when seeking
    back.
    
    Use ctx->first_anmf_offset to detect first keyframe instead of trying
    to count cur_frame.
---
 libavformat/webp_anim_dec.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/libavformat/webp_anim_dec.c b/libavformat/webp_anim_dec.c
index e81deea6c8..6cd90b3315 100644
--- a/libavformat/webp_anim_dec.c
+++ b/libavformat/webp_anim_dec.c
@@ -61,7 +61,7 @@ typedef struct WebPAnimDemuxContext {
     /*
      * variables for the key frame detection
      */
-    int cur_frame;                  ///< number of frames of the current 
animation file
+    int64_t first_anmf_offset;
     int vp8x_flags;
 
     int has_iccp;
@@ -70,8 +70,6 @@ typedef struct WebPAnimDemuxContext {
     int has_xmp;
 
     int usebgcolor;
-
-    int64_t first_anmf_offset;
 } WebPAnimDemuxContext;
 
 /**
@@ -253,7 +251,6 @@ static int webp_anim_read_packet(AVFormatContext *s, 
AVPacket *pkt)
         if (avio_feof(pb)) {
             if (!ctx->ignore_loop &&
                 (ctx->loop_count == 0 || ++ctx->cur_loop < ctx->loop_count)) {
-                ctx->cur_frame = 0;
                 ret = avio_seek(pb, ctx->first_anmf_offset, SEEK_SET);
                 if (ret < 0)
                     return ret;
@@ -273,7 +270,7 @@ static int webp_anim_read_packet(AVFormatContext *s, 
AVPacket *pkt)
             if (ret < 0)
                 return ret;
             pkt->pos = offset;
-            if (!ctx->cur_frame++)
+            if (offset == ctx->first_anmf_offset)
                 pkt->flags |= AV_PKT_FLAG_KEY;
             pkt->pts = AV_NOPTS_VALUE;
             pkt->dts = AV_NOPTS_VALUE;

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to