[Ffmpeg-cvslog] CVS: ffmpeg/libavformat utils.c,1.182,1.183
Baptiste Coudurier CVS
bcoudurier
Fri Mar 24 16:47:48 CET 2006
Update of /cvsroot/ffmpeg/ffmpeg/libavformat
In directory mail:/var2/tmp/cvs-serv14612/libavformat
Modified Files:
utils.c
Log Message:
use av_d2q to parse frame rate
Index: utils.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/utils.c,v
retrieving revision 1.182
retrieving revision 1.183
diff -u -d -r1.182 -r1.183
--- utils.c 21 Mar 2006 11:29:50 -0000 1.182
+++ utils.c 24 Mar 2006 15:47:44 -0000 1.183
@@ -2742,8 +2742,9 @@
}
else {
/* Finally we give up and parse it as double */
- *frame_rate_base = DEFAULT_FRAME_RATE_BASE; //FIXME use av_d2q()
- *frame_rate = (int)(strtod(arg, 0) * (*frame_rate_base) + 0.5);
+ AVRational time_base = av_d2q(strtod(arg, 0), DEFAULT_FRAME_RATE_BASE);
+ *frame_rate_base = time_base.den;
+ *frame_rate = time_base.num;
}
if (!*frame_rate || !*frame_rate_base)
return -1;
More information about the ffmpeg-cvslog
mailing list