[FFmpeg-cvslog] lavf/utils: avoid using programs for duration when there's only one

Rodger Combs git at videolan.org
Thu Oct 6 09:59:28 EEST 2016


ffmpeg | branch: master | Rodger Combs <rodger.combs at gmail.com> | Wed Oct  5 06:38:24 2016 -0500| [a6bce3ca90de81eb48db3a70df0b1c309d7d5cf9] | committer: Rodger Combs

lavf/utils: avoid using programs for duration when there's only one

This allows us to be more selective about the streams we derive durations from
(specifically, ignoring text streams with outlier end times) in the common case

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a6bce3ca90de81eb48db3a70df0b1c309d7d5cf9
---

 libavformat/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index d19cc5e..1aa3b50 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2582,7 +2582,7 @@ static void update_stream_timings(AVFormatContext *ic)
     if (start_time != INT64_MAX) {
         ic->start_time = start_time;
         if (end_time != INT64_MIN) {
-            if (ic->nb_programs) {
+            if (ic->nb_programs > 1) {
                 for (i = 0; i < ic->nb_programs; i++) {
                     p = ic->programs[i];
                     if (p->start_time != AV_NOPTS_VALUE && p->end_time > p->start_time)



More information about the ffmpeg-cvslog mailing list