[FFmpeg-devel] [PATCH] lavu/parseutils: reduce fraction in av_parse_ratio()
Stefano Sabatini
stefasab at gmail.com
Tue Oct 16 21:45:03 CEST 2012
Consistent with the a/b case, and with the documentation.
TODO: bump micro
---
libavutil/parseutils.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c
index 84bb9f7..134c07f 100644
--- a/libavutil/parseutils.c
+++ b/libavutil/parseutils.c
@@ -57,6 +57,8 @@ int av_parse_ratio(AVRational *q, const char *str, int max,
if (ret < 0)
return ret;
*q = av_d2q(d, max);
+ } else {
+ av_reduce(&q->num, &q->den, q->num, q->den, max);
}
gcd = av_gcd(FFABS(q->num), FFABS(q->den));
--
1.7.5.4
More information about the ffmpeg-devel
mailing list