Fix minor issue in NQC shotchanges checks

This commit is contained in:
OmrSi 2022-08-26 14:26:24 +03:00
parent 0ae6e52950
commit 7a596288a9

View File

@ -47,7 +47,8 @@ namespace Nikse.SubtitleEdit.Core.NetflixQualityCheck
if (previousStartShotChanges.Count > 0)
{
double nearestStartPrevShotChange = previousStartShotChanges.Aggregate((x, y) => Math.Abs(x - p.StartTime.TotalSeconds) < Math.Abs(y - p.StartTime.TotalSeconds) ? x : y);
if (SubtitleFormat.MillisecondsToFrames(p.StartTime.TotalMilliseconds - nearestStartPrevShotChange * 1000) < halfSecGapInFrames)
var gapToShotChange = SubtitleFormat.MillisecondsToFrames(p.StartTime.TotalMilliseconds - nearestStartPrevShotChange * 1000);
if (gapToShotChange != 0 && gapToShotChange < halfSecGapInFrames)
{
fixedParagraph.StartTime.TotalMilliseconds = nearestStartPrevShotChange * 1000;
comment = $"The in-cue is within {halfSecGapInFrames} frames after the shot change, snap the in-cue to the shot-change";