mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-04-24 17:12:34 +02:00
avformat/utils/avformat_find_stream_info: Move max_analyze_duration setup out of the packet loop
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
2addbeef8b
commit
1a426d5404
@ -3095,6 +3095,14 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
|
|||||||
// new streams might appear, no options for those
|
// new streams might appear, no options for those
|
||||||
int orig_nb_streams = ic->nb_streams;
|
int orig_nb_streams = ic->nb_streams;
|
||||||
int flush_codecs = ic->probesize > 0;
|
int flush_codecs = ic->probesize > 0;
|
||||||
|
int max_analyze_duration = ic->max_analyze_duration;
|
||||||
|
|
||||||
|
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 (ic->pb)
|
if (ic->pb)
|
||||||
av_log(ic, AV_LOG_DEBUG, "Before avformat_find_stream_info() pos: %"PRId64" bytes read:%"PRId64" seeks:%d\n",
|
av_log(ic, AV_LOG_DEBUG, "Before avformat_find_stream_info() pos: %"PRId64" bytes read:%"PRId64" seeks:%d\n",
|
||||||
@ -3296,14 +3304,6 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
|
|||||||
}
|
}
|
||||||
if (st->codec_info_nb_frames>1) {
|
if (st->codec_info_nb_frames>1) {
|
||||||
int64_t t = 0;
|
int64_t t = 0;
|
||||||
int max_analyze_duration = ic->max_analyze_duration;
|
|
||||||
|
|
||||||
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)
|
if (st->time_base.den > 0)
|
||||||
t = av_rescale_q(st->info->codec_info_duration, st->time_base, AV_TIME_BASE_Q);
|
t = av_rescale_q(st->info->codec_info_duration, st->time_base, AV_TIME_BASE_Q);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user