]> git.sesse.net Git - ffmpeg/commitdiff
avformat/utils: set max analyze duration depending on the circumstances
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 26 May 2014 20:10:41 +0000 (22:10 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 26 May 2014 20:33:01 +0000 (22:33 +0200)
Fixes Ticket3673

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/utils.c

index f07a33e6d5e10cb188938deddd88920b278ac8cf..f35e956f74aa37652734b4a11ecc9058daff2f77 100644 (file)
@@ -3291,8 +3291,12 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
             int64_t t = 0;
             int max_analyze_duration = ic->max_analyze_duration;
 
-            if (!max_analyze_duration)
-                max_analyze_duration = 5*AV_TIME_BASE;
+            if (!max_analyze_duration) {
+                if (!strcmp(ic->iformat->name, "flv") && !(ic->ctx_flags & AVFMTCTX_NOHEADER)) {
+                    max_analyze_duration = 10*AV_TIME_BASE;
+                } else
+                    max_analyze_duration = 5*AV_TIME_BASE;
+            }
 
             if (st->time_base.den > 0)
                 t = av_rescale_q(st->info->codec_info_duration, st->time_base, AV_TIME_BASE_Q);