aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodger Combs <rodger.combs@gmail.com>2016-10-05 06:38:24 -0500
committerRodger Combs <rodger.combs@gmail.com>2016-10-06 01:36:05 -0500
commita6bce3ca90de81eb48db3a70df0b1c309d7d5cf9 (patch)
treea83ee3738eb1035323290e25cc9fa3f93dfcaf6d
parent4c9c4fe8b21b22e83cde22b5fbaa947ebe5e66d9 (diff)
downloadffmpeg-a6bce3ca90de81eb48db3a70df0b1c309d7d5cf9.tar.gz
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
-rw-r--r--libavformat/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index d19cc5ea1b..1aa3b50bcb 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)