[FFmpeg-devel] [PATCH 2/9] lavf/demux: restrict video parser duration handling to just GIF

Anton Khirnov anton at khirnov.net
Sun Oct 1 15:55:45 EEST 2023


The parser does not have a timebase associated with it, so in general it
makes no sense for it to be exporting durations. Longer-term this
should be handled more cleanly with a new parser API.
---
 libavformat/demux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/demux.c b/libavformat/demux.c
index 6decb08698..45cdb8e1b7 100644
--- a/libavformat/demux.c
+++ b/libavformat/demux.c
@@ -1200,7 +1200,7 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt,
                                      st->time_base,
                                      AV_ROUND_DOWN);
             }
-        } else if ((s->iformat->flags & AVFMT_NOTIMESTAMPS) && st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
+        } else if (st->codecpar->codec_id == AV_CODEC_ID_GIF) {
             if (st->time_base.num > 0 && st->time_base.den > 0 &&
                 sti->parser->duration) {
                 out_pkt->duration = sti->parser->duration;
-- 
2.40.1



More information about the ffmpeg-devel mailing list