[FFmpeg-devel] [PATCH 2/7] lavf/demux: treat streams with AVSTREAM_PARSE_FULL_RAW as having timestamps

Anton Khirnov anton at khirnov.net
Sun Apr 9 16:27:41 EEST 2023


In this case the timestamps are set by the parser.
Cf. a6b3471c44fd981d3b33ea9050f78a0bc9494c5e

Required by the following commit.
---
 libavformat/demux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/demux.c b/libavformat/demux.c
index b19ab86d08d..06de71cd6e3 100644
--- a/libavformat/demux.c
+++ b/libavformat/demux.c
@@ -2569,7 +2569,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
                 extract_extradata_check(st))
                 break;
             if (sti->first_dts == AV_NOPTS_VALUE &&
-                !(ic->iformat->flags & AVFMT_NOTIMESTAMPS) &&
+                (!(ic->iformat->flags & AVFMT_NOTIMESTAMPS) || sti->need_parsing == AVSTREAM_PARSE_FULL_RAW) &&
                 sti->codec_info_nb_frames < ((st->disposition & AV_DISPOSITION_ATTACHED_PIC) ? 1 : ic->max_ts_probe) &&
                 (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO ||
                  st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO))
-- 
2.39.1



More information about the ffmpeg-devel mailing list