mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-24 20:22:41 +01:00
More general approach
This commit is contained in:
parent
13cfef9144
commit
c13db1f4a7
@ -539,23 +539,24 @@ namespace Nikse.SubtitleEdit.Core.Forms
|
|||||||
bestRightInCueFrame = newRightInCueFrame;
|
bestRightInCueFrame = newRightInCueFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check cases
|
// Re-check if, with the new cues, the subtitles are actually connected
|
||||||
var isLeftOutCueOnShotChange = IsCueOnShotChange(bestLeftOutCueFrame, false);
|
var newDistance = FramesToMilliseconds(bestRightInCueFrame) - FramesToMilliseconds(bestLeftOutCueFrame);
|
||||||
var isRightInCueOnShotChange = IsCueOnShotChange(bestRightInCueFrame, true);
|
if (newDistance < Configuration.Settings.BeautifyTimeCodes.Profile.ConnectedSubtitlesTreatConnected)
|
||||||
|
|
||||||
var performGeneralChaining = false;
|
|
||||||
|
|
||||||
if (isLeftOutCueOnShotChange && isRightInCueOnShotChange
|
|
||||||
&& bestLeftOutCueFrameInfo.result == FindBestCueResult.SnappedToRedZone && bestRightInCueFrameInfo.result == FindBestCueResult.SnappedToRedZone
|
|
||||||
&& bestLeftOutCueFrame == bestRightInCueFrame)
|
|
||||||
{
|
{
|
||||||
// If both cues are being snapped to the exact same shot change, the subtitles really are connected
|
// Yes, so handle using the designated function, ignoring its check connected check
|
||||||
// So, handle using the designated function, ignoring the "treat connected" value (because otherwise it would have handled it before going into this function)
|
// (because otherwise it would have handled it before going into the FixChainableSubtitles function)
|
||||||
FixConnectedSubtitles(leftParagraph, rightParagraph, checkConnected: false);
|
FixConnectedSubtitles(leftParagraph, rightParagraph, checkConnected: false);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (isRightInCueOnShotChange)
|
|
||||||
|
// Check cases
|
||||||
|
var isLeftOutCueOnShotChange = IsCueOnShotChange(bestLeftOutCueFrame, false);
|
||||||
|
var isRightInCueOnShotChange = IsCueOnShotChange(bestRightInCueFrame, true);
|
||||||
|
|
||||||
|
var performGeneralChaining = false;
|
||||||
|
|
||||||
|
if (isRightInCueOnShotChange)
|
||||||
{
|
{
|
||||||
// The right in cue is on a shot change
|
// The right in cue is on a shot change
|
||||||
// Try to chain the subtitles
|
// Try to chain the subtitles
|
||||||
|
Loading…
Reference in New Issue
Block a user