aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-05-26 21:54:27 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-05-26 22:33:01 +0200
commit52887aa409bf61ae949bf7b212cf9209feb14783 (patch)
tree9edb59e367236fbeaf3fac68236fa567e03550ba /libavformat/utils.c
parent60ef61242c331e04a1561db02ee8b630f929d3d4 (diff)
downloadffmpeg-52887aa409bf61ae949bf7b212cf9209feb14783.tar.gz
avformat: move default for max_analyze_duration into utils.c
this way we can do better tha a single fixed constant value Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index c9a3d4db1e..f07a33e6d5 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3289,6 +3289,11 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
}
if (st->codec_info_nb_frames>1) {
int64_t t = 0;
+ int max_analyze_duration = ic->max_analyze_duration;
+
+ if (!max_analyze_duration)
+ 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);
if (st->avg_frame_rate.num > 0)
@@ -3300,9 +3305,9 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
&& st->info->fps_last_dts != AV_NOPTS_VALUE)
t = FFMAX(t, av_rescale_q(st->info->fps_last_dts - st->info->fps_first_dts, st->time_base, AV_TIME_BASE_Q));
- if (t >= ic->max_analyze_duration) {
+ if (t >= max_analyze_duration) {
av_log(ic, AV_LOG_VERBOSE, "max_analyze_duration %d reached at %"PRId64" microseconds\n",
- ic->max_analyze_duration,
+ max_analyze_duration,
t);
break;
}