Possibly fix a rounding problem that causes subtitles with \pos to move a slightly bit around even though they shouldn't.

Originally committed to SVN as r1536.
This commit is contained in:
Niels Martin Hansen 2007-08-26 15:44:15 +00:00
parent 3518f381a7
commit 4cf49cf9fb

View file

@ -2283,6 +2283,7 @@ STDMETHODIMP CRenderedTextSubtitle::Render(SubPicDesc& spd, REFERENCE_TIME rt, d
if(t1 <= 0 && t2 <= 0) {t1 = 0; t2 = m_delay;}
if(m_time <= t1) p = p1;
else if (p1 == p2) p = p1; // jfs: avoid rounding error problems sometimes causing subtitles with \pos to jump around a bit
else if(t1 < m_time && m_time < t2)
{
double t = 1.0*(m_time-t1)/(t2-t1);