Fix ASSA rounding error - thx tormento :)

Work on #6343
This commit is contained in:
niksedk 2022-10-19 19:56:31 +02:00
parent 63357e83d8
commit a0704556c5
2 changed files with 3 additions and 2 deletions

View File

@ -69,6 +69,7 @@
* Fix installer dot net version check - thx Christoph
* Fix a few typos - thx nkh0472
* Fix for mp4 with vtt subtitles - thx LucretiaAudrey
* Fix rounding error when writing ASSA - thx tormento
3.6.7 (13th August 2022)

View File

@ -165,8 +165,8 @@ Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text"
}
foreach (var p in subtitle.Paragraphs)
{
var start = string.Format(timeCodeFormat, p.StartTime.Hours, p.StartTime.Minutes, p.StartTime.Seconds, p.StartTime.Milliseconds / 10);
var end = string.Format(timeCodeFormat, p.EndTime.Hours, p.EndTime.Minutes, p.EndTime.Seconds, p.EndTime.Milliseconds / 10);
var start = string.Format(timeCodeFormat, p.StartTime.Hours, p.StartTime.Minutes, p.StartTime.Seconds, (int)Math.Round(p.StartTime.Milliseconds / 10.0, MidpointRounding.AwayFromZero));
var end = string.Format(timeCodeFormat, p.EndTime.Hours, p.EndTime.Minutes, p.EndTime.Seconds, (int)Math.Round(p.EndTime.Milliseconds / 10.0, MidpointRounding.AwayFromZero));
var style = "Default";
if (!string.IsNullOrEmpty(p.Extra) && isValidAssHeader && styles.Contains(p.Extra))
{