Mercurial > libavformat.hg
comparison utils.c @ 1607:edb923014029 libavformat
do not base frame rate guess on just one duration
author | michael |
---|---|
date | Fri, 29 Dec 2006 21:16:21 +0000 |
parents | cffb8f8e1ed6 |
children | 70ce246379b5 |
comparison
equal
deleted
inserted
replaced
1606:8813741f7196 | 1607:edb923014029 |
---|---|
1957 st = ic->streams[i]; | 1957 st = ic->streams[i]; |
1958 if (st->codec->codec_type == CODEC_TYPE_VIDEO) { | 1958 if (st->codec->codec_type == CODEC_TYPE_VIDEO) { |
1959 if(st->codec->codec_id == CODEC_ID_RAWVIDEO && !st->codec->codec_tag && !st->codec->bits_per_sample) | 1959 if(st->codec->codec_id == CODEC_ID_RAWVIDEO && !st->codec->codec_tag && !st->codec->bits_per_sample) |
1960 st->codec->codec_tag= avcodec_pix_fmt_to_codec_tag(st->codec->pix_fmt); | 1960 st->codec->codec_tag= avcodec_pix_fmt_to_codec_tag(st->codec->pix_fmt); |
1961 | 1961 |
1962 if(duration_count[i] | 1962 if(duration_count[i]>1 |
1963 && (st->codec->time_base.num*101LL <= st->codec->time_base.den || st->codec->codec_id == CODEC_ID_MPEG2VIDEO) /*&& | 1963 && (st->codec->time_base.num*101LL <= st->codec->time_base.den || st->codec->codec_id == CODEC_ID_MPEG2VIDEO) /*&& |
1964 //FIXME we should not special case mpeg2, but this needs testing with non mpeg2 ... | 1964 //FIXME we should not special case mpeg2, but this needs testing with non mpeg2 ... |
1965 st->time_base.num*duration_sum[i]/duration_count[i]*101LL > st->time_base.den*/){ | 1965 st->time_base.num*duration_sum[i]/duration_count[i]*101LL > st->time_base.den*/){ |
1966 double best_error= 2*av_q2d(st->time_base); | 1966 double best_error= 2*av_q2d(st->time_base); |
1967 best_error= best_error*best_error*duration_count[i]*1000*12*30; | 1967 best_error= best_error*best_error*duration_count[i]*1000*12*30; |