diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c index 84bb9f7876..b201331fe1 100644 --- a/libavutil/parseutils.c +++ b/libavutil/parseutils.c @@ -57,12 +57,8 @@ int av_parse_ratio(AVRational *q, const char *str, int max, if (ret < 0) return ret; *q = av_d2q(d, max); - } - - gcd = av_gcd(FFABS(q->num), FFABS(q->den)); - if (gcd) { - q->num /= gcd; - q->den /= gcd; + } else { + av_reduce(&q->num, &q->den, q->num, q->den, max); } return 0; diff --git a/libavutil/version.h b/libavutil/version.h index 3e9c17fdbc..edbf8f759a 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -76,7 +76,7 @@ #define LIBAVUTIL_VERSION_MAJOR 51 #define LIBAVUTIL_VERSION_MINOR 76 -#define LIBAVUTIL_VERSION_MICRO 100 +#define LIBAVUTIL_VERSION_MICRO 101 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ LIBAVUTIL_VERSION_MINOR, \