summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2012-04-09 18:54:42 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-06-22 01:58:57 +0200
commit59163139679b0aa2cb84cd6d7a3f696ed5a5813a (patch)
tree458d32686b1acd13e9c6a3c27548ccc749a4c29d /libavformat/utils.c
parentcdb94139cccfa1434c9c6d7901ea571fd4569184 (diff)
avformat: offset fps calculation by one to include 60.00 fps
To ensure the full range of values is still used, also adjust all uses of this function to loop from 0 instead of 1. This way only 60.00 is added and nothing lost. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 8d82f9e37a..1a586ad2bb 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2421,7 +2421,7 @@ static void compute_chapters_end(AVFormatContext *s)
}
static int get_std_framerate(int i){
- if(i<60*12) return i*1001;
+ if(i<60*12) return (i+1)*1001;
else return ((const int[]){24,30,60,12,15,48})[i-60*12]*1000*12;
}
@@ -2618,7 +2618,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
// if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
// av_log(NULL, AV_LOG_ERROR, "%f\n", dts);
- for (i=1; i<FF_ARRAY_ELEMS(st->info->duration_error[0][0]); i++) {
+ for (i=0; i<FF_ARRAY_ELEMS(st->info->duration_error[0][0]); i++) {
int framerate= get_std_framerate(i);
double sdts= dts*framerate/(1001*12);
for(j=0; j<2; j++){
@@ -2727,7 +2727,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
int num = 0;
double best_error= 0.01;
- for (j=1; j<FF_ARRAY_ELEMS(st->info->duration_error[0][0]); j++) {
+ for (j=0; j<FF_ARRAY_ELEMS(st->info->duration_error[0][0]); j++) {
int k;
if(st->info->codec_info_duration && st->info->codec_info_duration*av_q2d(st->time_base) < (1001*12.0)/get_std_framerate(j))