summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-03-19 21:54:34 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-03-19 21:54:34 +0000
commit3a5601885b46c2dc97e85afa33075b41236a0170 (patch)
tree3fbbecaebc38e78b36050a52bd6576d072cdb5d5 /libavformat/utils.c
parentdd35beb29ba034cd26c2780c238a6707f8bd9580 (diff)
move max analyze duration check before considering new packet
Originally committed as revision 18051 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 7419cc6625..18ca13e5e4 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2137,8 +2137,11 @@ int av_find_stream_info(AVFormatContext *ic)
read_size += pkt->size;
st = ic->streams[pkt->stream_index];
- if(codec_info_nb_frames[st->index]>1)
+ if(codec_info_nb_frames[st->index]>1) {
+ if (st->time_base.den > 0 && av_rescale_q(codec_info_duration[st->index], st->time_base, AV_TIME_BASE_Q) >= ic->max_analyze_duration)
+ break;
codec_info_duration[st->index] += pkt->duration;
+ }
if (pkt->duration != 0)
codec_info_nb_frames[st->index]++;
@@ -2199,9 +2202,6 @@ int av_find_stream_info(AVFormatContext *ic)
(st->codec->codec_id == CODEC_ID_MPEG4 && !st->need_parsing))*/)
try_decode_frame(st, pkt->data, pkt->size);
- if (st->time_base.den > 0 && av_rescale_q(codec_info_duration[st->index], st->time_base, AV_TIME_BASE_Q) >= ic->max_analyze_duration) {
- break;
- }
count++;
}