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:
Diffstat (limited to 'src/filters/transform/VSFilter/DirectVobSub.cpp')
-rw-r--r--src/filters/transform/VSFilter/DirectVobSub.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/filters/transform/VSFilter/DirectVobSub.cpp b/src/filters/transform/VSFilter/DirectVobSub.cpp
index f8cdc9b1c..e264644a2 100644
--- a/src/filters/transform/VSFilter/DirectVobSub.cpp
+++ b/src/filters/transform/VSFilter/DirectVobSub.cpp
@@ -55,6 +55,10 @@ CDirectVobSub::CDirectVobSub()
m_fMediaFPSEnabled = !!theApp.GetProfileInt(ResStr(IDS_R_TIMING), ResStr(IDS_RTM_MEDIAFPSENABLED), FALSE);
m_ePARCompensationType = static_cast<CSimpleTextSubtitle::EPARCompensationType>(theApp.GetProfileInt(ResStr(IDS_R_TEXT), ResStr(IDS_RT_AUTOPARCOMPENSATION), 0));
+ int gcd = GCD(m_SubtitleSpeedMul, m_SubtitleSpeedDiv);
+ m_SubtitleSpeedNormalizedMul = m_SubtitleSpeedMul / gcd;
+ m_SubtitleSpeedNormalizedDiv = m_SubtitleSpeedDiv / gcd;
+
BYTE* pData = nullptr;
UINT nSize;
if (theApp.GetProfileBinary(ResStr(IDS_R_TIMING), ResStr(IDS_RTM_MEDIAFPS), &pData, &nSize) && pData) {
@@ -459,6 +463,10 @@ STDMETHODIMP CDirectVobSub::put_SubtitleTiming(int delay, int speedmul, int spee
m_SubtitleSpeedDiv = speeddiv;
}
+ int gcd = GCD(m_SubtitleSpeedMul, m_SubtitleSpeedDiv);
+ m_SubtitleSpeedNormalizedMul = m_SubtitleSpeedMul / gcd;
+ m_SubtitleSpeedNormalizedDiv = m_SubtitleSpeedDiv / gcd;
+
return S_OK;
}