comparison utils.c @ 1030:1aabcccb2efa libavformat

use av_d2q to parse frame rate
author bcoudurier
date Fri, 24 Mar 2006 15:47:44 +0000
parents bddcb32bde33
children d4a6d2ddc318
comparison
equal deleted inserted replaced
1029:6ddc77441867 1030:1aabcccb2efa
2740 else 2740 else
2741 *frame_rate = 0; 2741 *frame_rate = 0;
2742 } 2742 }
2743 else { 2743 else {
2744 /* Finally we give up and parse it as double */ 2744 /* Finally we give up and parse it as double */
2745 *frame_rate_base = DEFAULT_FRAME_RATE_BASE; //FIXME use av_d2q() 2745 AVRational time_base = av_d2q(strtod(arg, 0), DEFAULT_FRAME_RATE_BASE);
2746 *frame_rate = (int)(strtod(arg, 0) * (*frame_rate_base) + 0.5); 2746 *frame_rate_base = time_base.den;
2747 *frame_rate = time_base.num;
2747 } 2748 }
2748 if (!*frame_rate || !*frame_rate_base) 2749 if (!*frame_rate || !*frame_rate_base)
2749 return -1; 2750 return -1;
2750 else 2751 else
2751 return 0; 2752 return 0;