PR #21770 opened by ngaullier URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21770 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21770.patch
This is to reapply 18217bb0f5fb4ad9d93ea02edab078111cd83910. Its commit msg is still meaningful: "Using the max instead of the min avoids the progress stopping with gaps in sparse streams (subtitles)." Unfortunately, the comment "compute min output value" was left unchanged in this commit and this was pretty misleading... So, years later, the 'max_dts code' code was restored in 9b8cc36ce0b2417469d78c68780c8796886c202e and caused the regression when enabled by the following commit: d119ae2fd82a494d9430ff4d4fc262961a68c598. Also ignore streams with no data (AV_NOPTS_VALUE): when processing files having a subtitle track but no data at all, this fixes ffmpeg reporting N/A for both time and speed (also a regression). Signed-off-by: Nicolas Gaullier <[email protected]> >From fe6d98d8d62a2d1ab50fd26f782ac8979e695c17 Mon Sep 17 00:00:00 2001 From: Nicolas Gaullier <[email protected]> Date: Mon, 16 Feb 2026 16:43:51 +0100 Subject: [PATCH] fftools/ffmpeg_sched: make trailing_dts() report max_dts instead of min_dts This is to reapply 18217bb0f5fb4ad9d93ea02edab078111cd83910. Its commit msg is still meaningful: "Using the max instead of the min avoids the progress stopping with gaps in sparse streams (subtitles)." Unfortunately, the comment "compute min output value" was left unchanged in this commit and this was pretty misleading... So, years later, the 'max_dts code' code was restored in 9b8cc36ce0b2417469d78c68780c8796886c202e and caused the regression when enabled by the following commit: d119ae2fd82a494d9430ff4d4fc262961a68c598. Also ignore streams with no data (AV_NOPTS_VALUE): when processing files having a subtitle track but no data at all, this fixes ffmpeg reporting N/A for both time and speed (also a regression). Signed-off-by: Nicolas Gaullier <[email protected]> --- fftools/ffmpeg_sched.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fftools/ffmpeg_sched.c b/fftools/ffmpeg_sched.c index 517ff1ea85..12e6133667 100644 --- a/fftools/ffmpeg_sched.c +++ b/fftools/ffmpeg_sched.c @@ -437,7 +437,7 @@ static void task_init(Scheduler *sch, SchTask *task, enum SchedulerNodeType type static int64_t trailing_dts(const Scheduler *sch, int count_finished) { - int64_t min_dts = INT64_MAX; + int64_t max_dts = INT64_MIN; for (unsigned i = 0; i < sch->nb_mux; i++) { const SchMux *mux = &sch->mux[i]; @@ -447,14 +447,12 @@ static int64_t trailing_dts(const Scheduler *sch, int count_finished) if (ms->source_finished && !count_finished) continue; - if (ms->last_dts == AV_NOPTS_VALUE) - return AV_NOPTS_VALUE; - - min_dts = FFMIN(min_dts, ms->last_dts); + if (ms->last_dts != AV_NOPTS_VALUE) + max_dts = FFMAX(max_dts, ms->last_dts); } } - return min_dts == INT64_MAX ? AV_NOPTS_VALUE : min_dts; + return max_dts == INT64_MIN ? AV_NOPTS_VALUE : max_dts; } void sch_remove_filtergraph(Scheduler *sch, int idx) -- 2.52.0 _______________________________________________ ffmpeg-devel mailing list -- [email protected] To unsubscribe send an email to [email protected]
