aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2010-02-23 16:29:57 +0000
committerMichael Niedermayer <michaelni@gmx.at>2010-02-23 16:29:57 +0000
commitab392695d50ca29fa89e5ddce3df3cbf739ef654 (patch)
treec196a1174bea4ffaa5862c0302c50743ececcba0 /libavformat/utils.c
parentd962706f96ba65d64e847fe4bdadfdba95a7f9d2 (diff)
downloadffmpeg-ab392695d50ca29fa89e5ddce3df3cbf739ef654.tar.gz
Count all frames with codec_info_nb_frames not just ones with non zero
duration. I hope this breaks nothing. Its needed for my fix of issue1156 Originally committed as revision 22001 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index aee7b98608..1fbceea8a7 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2184,7 +2184,6 @@ int av_find_stream_info(AVFormatContext *ic)
}
codec_info_duration[st->index] += pkt->duration;
}
- if (pkt->duration != 0)
st->codec_info_nb_frames++;
{
@@ -2241,7 +2240,7 @@ int av_find_stream_info(AVFormatContext *ic)
}
for(i=0;i<ic->nb_streams;i++) {
st = ic->streams[i];
- if(st->codec_info_nb_frames>2 && !st->avg_frame_rate.num)
+ if(st->codec_info_nb_frames>2 && !st->avg_frame_rate.num && codec_info_duration[i])
av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
(st->codec_info_nb_frames-2)*(int64_t)st->time_base.den,
codec_info_duration[i] *(int64_t)st->time_base.num, 60000);