Commit 67dd33f9 authored by Baptiste Coudurier's avatar Baptiste Coudurier

use av_d2q to parse frame rate

Originally committed as revision 5209 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 0dd39bfe
...@@ -2742,8 +2742,9 @@ int parse_frame_rate(int *frame_rate, int *frame_rate_base, const char *arg) ...@@ -2742,8 +2742,9 @@ int parse_frame_rate(int *frame_rate, int *frame_rate_base, const char *arg)
} }
else { else {
/* Finally we give up and parse it as double */ /* Finally we give up and parse it as double */
*frame_rate_base = DEFAULT_FRAME_RATE_BASE; //FIXME use av_d2q() AVRational time_base = av_d2q(strtod(arg, 0), DEFAULT_FRAME_RATE_BASE);
*frame_rate = (int)(strtod(arg, 0) * (*frame_rate_base) + 0.5); *frame_rate_base = time_base.den;
*frame_rate = time_base.num;
} }
if (!*frame_rate || !*frame_rate_base) if (!*frame_rate || !*frame_rate_base)
return -1; return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment