diff mbox series

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

Message ID 20230409132746.19756-2-anton@khirnov.net
State Accepted
Commit 7b827a029338ef8af689e84a352825797b286e26
Headers show
Series [FFmpeg-devel,1/7] lavf/rawdec: set avg_frame_rate | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov April 9, 2023, 1:27 p.m. UTC
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 mbox series

Patch

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))