diff mbox series

[FFmpeg-devel,07/25] fftools/ffmpeg: stop using InputStream.pts in ts_discontinuity_detect()

Message ID 20230419195243.2974-7-anton@khirnov.net
State Accepted
Commit d8bc37f1f446d5798d77830e197f02188919a313
Headers show
Series [FFmpeg-devel,01/25] fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration | expand

Checks

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

Commit Message

Anton Khirnov April 19, 2023, 7:52 p.m. UTC
ts_discontinuity_detect() is applied right after demuxing, while
InputStream.pts is a post-decoding timestamp, which may be delayed with
respect to demuxing by an arbitrary amount (e.g. depending on the thread
count when frame threading is used).
---
 fftools/ffmpeg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index a7e856e9e2..cc087ea7de 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2121,7 +2121,7 @@  static void ts_discontinuity_detect(InputFile *ifile, InputStream *ist,
         int64_t delta = pkt_dts - ist->next_dts;
         if (fmt_is_discont) {
             if (FFABS(delta) > 1LL * dts_delta_threshold * AV_TIME_BASE ||
-                pkt_dts + AV_TIME_BASE/10 < FFMAX(ist->pts, ist->dts)) {
+                pkt_dts + AV_TIME_BASE/10 < ist->dts) {
                 ifile->ts_offset_discont -= delta;
                 av_log(NULL, AV_LOG_WARNING,
                        "timestamp discontinuity for stream #%d:%d "