Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUnderground78 <underground78@users.sourceforge.net>2013-01-25 23:56:37 +0400
committerUnderground78 <underground78@users.sourceforge.net>2013-01-26 00:16:10 +0400
commitc1fac3a506861e0879b5b30c1fa4c362f46a77c2 (patch)
treeb4d60734c28e379ed33001bc8a99a852d6b61667 /src/filters/parser/BaseSplitter
parent4709ce868f7d4c21296f4f13cba851744985cb0e (diff)
Cosmetics: Use the GCD function when possible and rename it to use English.
Diffstat (limited to 'src/filters/parser/BaseSplitter')
-rw-r--r--src/filters/parser/BaseSplitter/BaseSplitterFileEx.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/filters/parser/BaseSplitter/BaseSplitterFileEx.cpp b/src/filters/parser/BaseSplitter/BaseSplitterFileEx.cpp
index 244784e0b..7bfdf383a 100644
--- a/src/filters/parser/BaseSplitter/BaseSplitterFileEx.cpp
+++ b/src/filters/parser/BaseSplitter/BaseSplitterFileEx.cpp
@@ -1,6 +1,6 @@
/*
* (C) 2003-2006 Gabest
- * (C) 2006-2012 see Authors.txt
+ * (C) 2006-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -394,14 +394,10 @@ bool CBaseSplitterFileEx::Read(seqhdr& h, int len, CMediaType* pmt)
h.ifps = 10 * h.ifps / 27;
h.bitrate = h.bitrate == (1 << 30) - 1 ? 0 : h.bitrate * 400;
- DWORD a = h.arx, b = h.ary;
- while (a) {
- DWORD tmp = a;
- a = b % tmp;
- b = tmp;
- }
- if (b) {
- h.arx /= b, h.ary /= b;
+ int gcd = GCD(h.arx, h.ary);
+ if (gcd > 1) {
+ h.arx /= gcd;
+ h.ary /= gcd;
}
if (!pmt) {
@@ -1708,9 +1704,10 @@ bool CBaseSplitterFileEx::Read(avchdr& h, int len, CMediaType* pmt)
h.sar.den = 1;
}
CSize aspect(h.width * h.sar.num, h.height * h.sar.den);
- int lnko = LNKO(aspect.cx, aspect.cy);
- if (lnko > 1) {
- aspect.cx /= lnko, aspect.cy /= lnko;
+ int gcd = GCD(aspect.cx, aspect.cy);
+ if (gcd > 1) {
+ aspect.cx /= gcd;
+ aspect.cy /= gcd;
}
if (aspect.cx * 2 < aspect.cy) {
@@ -2178,9 +2175,10 @@ bool CBaseSplitterFileEx::Read(vc1hdr& h, int len, CMediaType* pmt, int guid_fla
if (h.width == h.sar.num && h.height == h.sar.den) {
aspect = CSize(h.width, h.height);
}
- int lnko = LNKO(aspect.cx, aspect.cy);
- if (lnko > 1) {
- aspect.cx /= lnko, aspect.cy /= lnko;
+ int gcd = GCD(aspect.cx, aspect.cy);
+ if (gcd > 1) {
+ aspect.cx /= gcd;
+ aspect.cy /= gcd;
}
vi->dwPictAspectRatioX = aspect.cx;