[FFmpeg-cvslog] lavf/utils: avoid giving up probing early with long subtitle events

Rodger Combs git at videolan.org
Sat Oct 3 12:20:57 CEST 2015


ffmpeg | branch: master | Rodger Combs <rodger.combs at gmail.com> | Fri Oct  2 22:39:24 2015 -0500| [9825a24e5b1c34663d672961ebd2561a009b23e9] | committer: Michael Niedermayer

lavf/utils: avoid giving up probing early with long subtitle events

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/utils.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index dc83608..689473e 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;
             }
         }



More information about the ffmpeg-cvslog mailing list