# HG changeset patch # User michael # Date 1266942597 0 # Node ID 07214788e1e1af48ee9639b7a1142135726e3260 # Parent c9466f1186843ebb71cc2a71d4e73ebcdd4112f5 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 diff -r c9466f118684 -r 07214788e1e1 utils.c --- a/utils.c Tue Feb 23 15:07:18 2010 +0000 +++ b/utils.c Tue Feb 23 16:29:57 2010 +0000 @@ -2184,7 +2184,6 @@ } codec_info_duration[st->index] += pkt->duration; } - if (pkt->duration != 0) st->codec_info_nb_frames++; { @@ -2241,7 +2240,7 @@ } for(i=0;inb_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);