mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 03:02:35 +01:00
Merge branch 'master' of https://github.com/SubtitleEdit/subtitleedit
This commit is contained in:
commit
f45f3b3c32
@ -19,7 +19,7 @@ namespace Nikse.SubtitleEdit.Core.NetflixQualityCheck
|
||||
}
|
||||
|
||||
double twoFramesGap = 1000.0 / controller.FrameRate * 2.0;
|
||||
int halfSecGap = (int)Math.Round(controller.FrameRate / 2);
|
||||
int halfSecGap = (int)Math.Round(controller.FrameRate / 2, MidpointRounding.AwayFromZero);
|
||||
|
||||
for (int index = 0; index < subtitle.Paragraphs.Count; index++)
|
||||
{
|
||||
|
@ -25,7 +25,7 @@ namespace Nikse.SubtitleEdit.Core.NetflixQualityCheck
|
||||
return;
|
||||
}
|
||||
|
||||
int halfSecGapInFrames = (int)Math.Round(controller.FrameRate / 2);
|
||||
int halfSecGapInFrames = (int)Math.Round(controller.FrameRate / 2, MidpointRounding.AwayFromZero);
|
||||
double twoFramesGap = 1000.0 / controller.FrameRate * 2.0;
|
||||
|
||||
foreach (Paragraph p in subtitle.Paragraphs)
|
||||
@ -54,7 +54,7 @@ namespace Nikse.SubtitleEdit.Core.NetflixQualityCheck
|
||||
{
|
||||
double nearestStartNextSceneChange = nextStartSceneChanges.Aggregate((x, y) => Math.Abs(x - p.StartTime.TotalSeconds) < Math.Abs(y - p.StartTime.TotalSeconds) ? x : y);
|
||||
var gapToSceneChange = SubtitleFormat.MillisecondsToFrames(nearestStartNextSceneChange * 1000 - p.StartTime.TotalMilliseconds);
|
||||
var threshold = (int)Math.Round(halfSecGapInFrames * 0.75);
|
||||
var threshold = (int)Math.Round(halfSecGapInFrames * 0.75, MidpointRounding.AwayFromZero);
|
||||
if (gapToSceneChange < halfSecGapInFrames)
|
||||
{
|
||||
if (gapToSceneChange < threshold)
|
||||
|
@ -448,7 +448,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
|
||||
public static int MillisecondsToFramesMaxFrameRate(double milliseconds)
|
||||
{
|
||||
int frames = (int)Math.Round(milliseconds / (TimeCode.BaseUnit / GetFrameForCalculation(Configuration.Settings.General.CurrentFrameRate)));
|
||||
int frames = (int)Math.Round(milliseconds / (TimeCode.BaseUnit / GetFrameForCalculation(Configuration.Settings.General.CurrentFrameRate)), MidpointRounding.AwayFromZero);
|
||||
if (frames >= Configuration.Settings.General.CurrentFrameRate)
|
||||
{
|
||||
frames = (int)(Configuration.Settings.General.CurrentFrameRate - 0.01);
|
||||
|
@ -65,7 +65,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
checkBoxNoItalics.Checked = !_netflixQualityController.AllowItalics;
|
||||
checkBoxNoItalics.Enabled = !_netflixQualityController.AllowItalics;
|
||||
|
||||
int halfSecGapInFrames = (int)Math.Round(_frameRate / 2);
|
||||
int halfSecGapInFrames = (int)Math.Round(_frameRate / 2, MidpointRounding.AwayFromZero);
|
||||
checkBoxGapBridge.Text = $"Frame gap: 3 to {halfSecGapInFrames - 1} frames => 2 frames";
|
||||
|
||||
var sceneChangesExist = false;
|
||||
|
Loading…
Reference in New Issue
Block a user