summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorRodger Combs <rodger.combs@gmail.com>2015-10-02 22:39:24 -0500
committerMichael Niedermayer <michael@niedermayer.cc>2015-10-03 12:10:03 +0200
commit9825a24e5b1c34663d672961ebd2561a009b23e9 (patch)
treecd46dba3d9a593d7dfdbc10a4a3d2397a135beed /libavformat
parent85c92789b60416bb89f7938fa236c558603559f6 (diff)
lavf/utils: avoid giving up probing early with long subtitle events
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/utils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index dc83608b1f..689473e9fb 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3347,7 +3347,10 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
break;
}
if (pkt->duration) {
- st->info->codec_info_duration += pkt->duration;
+ if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE && pkt->pts != AV_NOPTS_VALUE && pkt->pts >= st->start_time) {
+ st->info->codec_info_duration = FFMIN(pkt->pts - st->start_time, st->info->codec_info_duration + pkt->duration);
+ } else
+ st->info->codec_info_duration += pkt->duration;
st->info->codec_info_duration_fields += st->parser && st->need_parsing && st->codec->ticks_per_frame ==2 ? st->parser->repeat_pict + 1 : 2;
}
}