[FFmpeg-devel] [PATCH 1/2] avformat/gif: use last packet duration

Paul B Mahol onemda at gmail.com
Sun Aug 29 20:09:54 EEST 2021


Signed-off-by: Paul B Mahol <onemda at gmail.com>
---
 libavformat/gif.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/gif.c b/libavformat/gif.c
index cba87d3eae..61a45d73ca 100644
--- a/libavformat/gif.c
+++ b/libavformat/gif.c
@@ -87,6 +87,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 (!new && prev->duration)
+        gif->duration = prev->duration;
 
     return gif->duration;
 }
-- 
2.17.1



More information about the ffmpeg-devel mailing list