Possible fix for Adjust/Set end & go to the next (F10)

Work on #7247
This commit is contained in:
niksedk 2023-08-18 02:30:06 +02:00
parent 3c8a2859ca
commit a46f10ea5e

View File

@ -25129,13 +25129,18 @@ namespace Nikse.SubtitleEdit.Forms
{
int index = SubtitleListview1.SelectedItems[0].Index;
double videoPosition = mediaPlayer.CurrentPosition;
var temp = new Paragraph(_subtitle.Paragraphs[index]);
if (!mediaPlayer.IsPaused)
{
videoPosition -= Configuration.Settings.General.SetStartEndHumanDelay / TimeCode.BaseUnit;
}
if (videoPosition < temp.StartTime.TotalSeconds - 0.1)
{
return;
}
string oldDuration = _subtitle.Paragraphs[index].Duration.ToString();
var temp = new Paragraph(_subtitle.Paragraphs[index]);
temp.EndTime.TotalMilliseconds = TimeCode.FromSeconds(videoPosition).TotalMilliseconds;
MakeHistoryForUndo(string.Format(_language.DisplayTimeAdjustedX, "#" + _subtitle.Paragraphs[index].Number + ": " + oldDuration + " -> " + temp.Duration));
_makeHistoryPaused = true;