Mercurial > libavformat.hg
comparison utils.c @ 3118:4410d9725469 libavformat
do not reset duration_error for all streams, only reset current stream, fix wrong_fps.gxf
author | bcoudurier |
---|---|
date | Thu, 06 Mar 2008 17:44:42 +0000 |
parents | 74a63dbf5509 |
children | b5e2ce291882 |
comparison
equal
deleted
inserted
replaced
3117:021b8af968cd | 3118:4410d9725469 |
---|---|
1930 double dur= duration * av_q2d(st->time_base); | 1930 double dur= duration * av_q2d(st->time_base); |
1931 | 1931 |
1932 // if(st->codec->codec_type == CODEC_TYPE_VIDEO) | 1932 // if(st->codec->codec_type == CODEC_TYPE_VIDEO) |
1933 // av_log(NULL, AV_LOG_ERROR, "%f\n", dur); | 1933 // av_log(NULL, AV_LOG_ERROR, "%f\n", dur); |
1934 if(duration_count[index] < 2) | 1934 if(duration_count[index] < 2) |
1935 memset(duration_error, 0, MAX_STREAMS * sizeof(*duration_error)); | 1935 memset(duration_error[index], 0, sizeof(*duration_error)); |
1936 for(i=1; i<MAX_STD_TIMEBASES; i++){ | 1936 for(i=1; i<MAX_STD_TIMEBASES; i++){ |
1937 int framerate= get_std_framerate(i); | 1937 int framerate= get_std_framerate(i); |
1938 int ticks= lrintf(dur*framerate/(1001*12)); | 1938 int ticks= lrintf(dur*framerate/(1001*12)); |
1939 double error= dur - ticks*1001*12/(double)framerate; | 1939 double error= dur - ticks*1001*12/(double)framerate; |
1940 duration_error[index][i] += error*error; | 1940 duration_error[index][i] += error*error; |