ffmpeg: count finished streams for last stats line.
authorNicolas George <nicolas.george@normalesup.org>
Tue, 28 Aug 2012 21:19:33 +0000 (23:19 +0200)
committerNicolas George <nicolas.george@normalesup.org>
Tue, 28 Aug 2012 21:19:33 +0000 (23:19 +0200)
Otherwise, all streams are finished and the time is nonsensical.

ffmpeg.c

index 58308c9..a980303 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1154,7 +1154,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
             vid = 1;
         }
         /* compute min output value */
-        if (!ost->finished && ost->st->pts.val != AV_NOPTS_VALUE)
+        if ((is_last_report || !ost->finished) && ost->st->pts.val != AV_NOPTS_VALUE)
             pts = FFMAX(pts, av_rescale_q(ost->st->pts.val,
                                           ost->st->time_base, AV_TIME_BASE_Q));
     }