Merge pull request #8936 from Flitskikker/feature/btc-improvement-20241021

Another small Beautify time codes improvement
This commit is contained in:
Nikolaj Olsson 2024-10-24 17:57:36 +02:00 committed by GitHub
commit 9b41308c5a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -363,11 +363,23 @@ namespace Nikse.SubtitleEdit.Core.Forms
}
}
else
{
// Check if there are really no shot changes in between
var firstShotChangeInBetween = GetFirstShotChangeFrameInBetween(bestLeftOutCueFrameInfo.cueFrame, bestRightInCueFrameInfo.cueFrame);
var lastShotChangeInBetween = GetLastShotChangeFrameInBetween(bestLeftOutCueFrameInfo.cueFrame, bestRightInCueFrameInfo.cueFrame);
if (firstShotChangeInBetween != null || lastShotChangeInBetween != null)
{
// There are, so snap to the one that is closest to either of the two cues
AlignCuesAroundClosestShotChange(firstShotChangeInBetween ?? int.MinValue, lastShotChangeInBetween ?? int.MaxValue);
}
else
{
// Fallback when no shot changes were apparently found: just chain them
newLeftOutCueFrame = newRightInCueFrame - Configuration.Settings.BeautifyTimeCodes.Profile.Gap;
}
}
}
else
{
// Just chain them