This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 8a0ae6b344 fftools/ffmpeg_sched: report progress using max dts instead 
of trailing_dts()
8a0ae6b344 is described below

commit 8a0ae6b344b0076db954a5c05c352052797bc95b
Author:     Nicolas Gaullier <[email protected]>
AuthorDate: Tue Feb 17 12:07:51 2026 +0100
Commit:     James Almer <[email protected]>
CommitDate: Thu Mar 12 12:15:15 2026 +0000

    fftools/ffmpeg_sched: report progress using max dts instead of 
trailing_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)."
    
    Also on a very similar issue: currently, a single stream with
    no data makes ffmpeg reports N/A for both time and speed.
    Fix this by ignoring missing dtses.
    
    Fix regressions since d119ae2fd82a494d9430ff4d4fc262961a68c598.
    
    Signed-off-by: Nicolas Gaullier <[email protected]>
---
 fftools/ffmpeg_sched.c | 30 +++++++++++++++++++++++++-----
 1 file changed, 25 insertions(+), 5 deletions(-)

diff --git a/fftools/ffmpeg_sched.c b/fftools/ffmpeg_sched.c
index 517ff1ea85..dc5800d094 100644
--- a/fftools/ffmpeg_sched.c
+++ b/fftools/ffmpeg_sched.c
@@ -435,7 +435,7 @@ static void task_init(Scheduler *sch, SchTask *task, enum 
SchedulerNodeType type
     task->func_arg  = func_arg;
 }
 
-static int64_t trailing_dts(const Scheduler *sch, int count_finished)
+static int64_t trailing_dts(const Scheduler *sch)
 {
     int64_t min_dts = INT64_MAX;
 
@@ -445,7 +445,7 @@ static int64_t trailing_dts(const Scheduler *sch, int 
count_finished)
         for (unsigned j = 0; j < mux->nb_streams; j++) {
             const SchMuxStream *ms = &mux->streams[j];
 
-            if (ms->source_finished && !count_finished)
+            if (ms->source_finished)
                 continue;
             if (ms->last_dts == AV_NOPTS_VALUE)
                 return AV_NOPTS_VALUE;
@@ -457,6 +457,26 @@ static int64_t trailing_dts(const Scheduler *sch, int 
count_finished)
     return min_dts == INT64_MAX ? AV_NOPTS_VALUE : min_dts;
 }
 
+static int64_t progressing_dts(const Scheduler *sch, int count_finished)
+{
+    int64_t max_dts = INT64_MIN;
+
+    for (unsigned i = 0; i < sch->nb_mux; i++) {
+        const SchMux *mux = &sch->mux[i];
+
+        for (unsigned j = 0; j < mux->nb_streams; j++) {
+            const SchMuxStream *ms = &mux->streams[j];
+
+            if (ms->source_finished && !count_finished)
+                continue;
+            if (ms->last_dts != AV_NOPTS_VALUE)
+                max_dts = FFMAX(max_dts, ms->last_dts);
+        }
+    }
+
+    return max_dts == INT64_MIN ? AV_NOPTS_VALUE : max_dts;
+}
+
 void sch_remove_filtergraph(Scheduler *sch, int idx)
 {
     SchFilterGraph *fg = &sch->filters[idx];
@@ -1399,9 +1419,9 @@ static void schedule_update_locked(Scheduler *sch)
     if (atomic_load(&sch->terminate))
         return;
 
-    dts = trailing_dts(sch, 0);
+    dts = trailing_dts(sch);
 
-    atomic_store(&sch->last_dts, dts);
+    atomic_store(&sch->last_dts, progressing_dts(sch, 0));
 
     // initialize our internal state
     for (unsigned type = 0; type < 2; type++)
@@ -2768,7 +2788,7 @@ int sch_stop(Scheduler *sch, int64_t *finish_ts)
     }
 
     if (finish_ts)
-        *finish_ts = trailing_dts(sch, 1);
+        *finish_ts = progressing_dts(sch, 1);
 
     sch->state = SCH_STATE_STOPPED;
 

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to