[FFmpeg-devel] [PATCH] avformat/jpegxl_anim_dec: set pos for generic index

Leo Izen leo.izen at gmail.com
Thu Mar 21 22:24:39 EET 2024


avpkt->pos needs to be set for generic indexing or features such as the
stream_loop option will not work.

Co-authored-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
Signed-off-by: Leo Izen <leo.izen at gmail.com>
---
 libavformat/jpegxl_anim_dec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/jpegxl_anim_dec.c b/libavformat/jpegxl_anim_dec.c
index f749b378b3..78dc16017d 100644
--- a/libavformat/jpegxl_anim_dec.c
+++ b/libavformat/jpegxl_anim_dec.c
@@ -171,6 +171,8 @@ static int jpegxl_anim_read_packet(AVFormatContext *s, AVPacket *pkt)
         av_buffer_unref(&ctx->initial);
     }
 
+    pkt->pos = avio_tell(pb) - offset;
+
     ret = avio_read(pb, pkt->data + offset, size - offset);
     if (ret < 0)
         return ret;
-- 
2.44.0



More information about the ffmpeg-devel mailing list