diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2006-03-24 15:47:44 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2006-03-24 15:47:44 +0000 |
commit | 67dd33f90efcab52a4730ba5d84faddf7358e9fa (patch) | |
tree | 4917e28679422e7b20f7f89af0df63d26c3e87d6 /libavformat/utils.c | |
parent | 0dd39bfe5d5177a961cdcd64996261a58aff7289 (diff) | |
download | ffmpeg-67dd33f90efcab52a4730ba5d84faddf7358e9fa.tar.gz |
use av_d2q to parse frame rate
Originally committed as revision 5209 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 560aace259..6f15dd2f42 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2742,8 +2742,9 @@ int parse_frame_rate(int *frame_rate, int *frame_rate_base, const char *arg) } 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; |