Revision 1694118b

View differences:

libavformat/utils.c
1895 1895

  
1896 1896
//                if(st->codec->codec_type == CODEC_TYPE_VIDEO)
1897 1897
//                    av_log(NULL, AV_LOG_ERROR, "%f\n", dur);
1898
                if(duration_count[index] > 0){
1898
                if(duration_count[index] < 2)
1899
                    memset(duration_error, 0, sizeof(duration_error));
1899 1900
                    for(i=1; i<MAX_STD_TIMEBASES; i++){
1900 1901
                        int framerate= get_std_framerate(i);
1901 1902
                        int ticks= lrintf(dur*framerate/(1001*12));
1902 1903
                        double error= dur - ticks*1001*12/(double)framerate;
1903 1904
                        duration_error[index][i] += error*error;
1904 1905
                    }
1905
                }
1906 1906
                duration_count[index]++;
1907 1907

  
1908 1908
                if(st->codec_info_nb_frames == 0 && 0)
......
1960 1960
            if(st->codec->codec_id == CODEC_ID_RAWVIDEO && !st->codec->codec_tag && !st->codec->bits_per_sample)
1961 1961
                st->codec->codec_tag= avcodec_pix_fmt_to_codec_tag(st->codec->pix_fmt);
1962 1962

  
1963
            if(1
1963
            if(duration_count[i]
1964 1964
               && (st->codec->time_base.num*101LL <= st->codec->time_base.den || st->codec->codec_id == CODEC_ID_MPEG2VIDEO) /*&&
1965 1965
               //FIXME we should not special case mpeg2, but this needs testing with non mpeg2 ...
1966 1966
               st->time_base.num*duration_sum[i]/duration_count[i]*101LL > st->time_base.den*/){

Also available in: Unified diff