Check for in-between shot changes when connecting subtitles while using a very high "Tread as connected" setting

This commit is contained in:
Martijn van Berkel (Flitskikker) 2024-10-21 21:34:12 +02:00
parent 5fd050a1b8
commit bd6f556fbf

View File

@ -364,8 +364,20 @@ namespace Nikse.SubtitleEdit.Core.Forms
} }
else else
{ {
// Fallback when no shot changes were apparently found: just chain them // Check if there are really no shot changes in between
newLeftOutCueFrame = newRightInCueFrame - Configuration.Settings.BeautifyTimeCodes.Profile.Gap; 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 else