From ff72256235aeaa2a4e197b54f69bad36d61a57d0 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sat, 20 May 2023 12:33:29 +0200 Subject: [PATCH] avformat/gif: use last frame duration --- libavformat/gif.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/gif.c b/libavformat/gif.c index bfa7deb598..568867cc5d 100644 --- a/libavformat/gif.c +++ b/libavformat/gif.c @@ -88,6 +88,8 @@ static int gif_get_delay(GIFContext *gif, AVPacket *prev, AVPacket *new) gif->duration = av_clip_uint16(new->pts - prev->pts); else if (!new && gif->last_delay >= 0) gif->duration = gif->last_delay; + else if (prev->duration) + gif->duration = prev->duration; return gif->duration; }