Refact ChangeFrameRate

This commit is contained in:
Ivandro Ismael 2016-01-29 15:18:29 +00:00
parent ee6bf84cb8
commit 5b2f9fe2aa

View File

@ -299,10 +299,8 @@ namespace Nikse.SubtitleEdit.Core
{
foreach (Paragraph p in Paragraphs)
{
double startFrame = p.StartTime.TotalMilliseconds / TimeCode.BaseUnit * oldFrameRate;
double endFrame = p.EndTime.TotalMilliseconds / TimeCode.BaseUnit * oldFrameRate;
p.StartTime.TotalMilliseconds = startFrame * (TimeCode.BaseUnit / newFrameRate);
p.EndTime.TotalMilliseconds = endFrame * (TimeCode.BaseUnit / newFrameRate);
p.StartTime.TotalMilliseconds = (p.StartTime.TotalMilliseconds * oldFrameRate / newFrameRate);
p.EndTime.TotalMilliseconds = (p.EndTime.TotalMilliseconds * oldFrameRate / newFrameRate);
p.CalculateFrameNumbersFromTimeCodes(newFrameRate);
}
}