[FFmpeg-cvslog] r22001 - trunk/libavformat/utils.c
michael
subversion
Tue Feb 23 17:29:58 CET 2010
Author: michael
Date: Tue Feb 23 17:29:57 2010
New Revision: 22001
Log:
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
Modified:
trunk/libavformat/utils.c
Modified: trunk/libavformat/utils.c
==============================================================================
--- trunk/libavformat/utils.c Tue Feb 23 17:12:30 2010 (r22000)
+++ trunk/libavformat/utils.c Tue Feb 23 17:29:57 2010 (r22001)
@@ -2184,7 +2184,6 @@ int av_find_stream_info(AVFormatContext
}
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
}
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);
More information about the ffmpeg-cvslog
mailing list