avformat/gif: use last frame duration

This commit is contained in:
Paul B Mahol 2023-05-20 12:33:29 +02:00
parent bd9d984c11
commit ff72256235

View File

@ -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;
}