Fix in Visual Sync: if end-time is after video length, end-pos will be video length - 2 secs

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@175 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2010-12-04 13:10:20 +00:00
parent 11b9a4f962
commit c94b8b875d

View File

@ -95,7 +95,15 @@ namespace Nikse.SubtitleEdit.Forms
mediaPlayer.Pause();
if (index != -1)
{
mediaPlayer.CurrentPosition = _paragraphs[index].StartTime.TotalMilliseconds/1000.0;
double indexPositionInSeconds = _paragraphs[index].StartTime.TotalMilliseconds / 1000.0;
if (indexPositionInSeconds > mediaPlayer.Duration)
indexPositionInSeconds = mediaPlayer.Duration - (2 * 60);
if (indexPositionInSeconds < 0)
indexPositionInSeconds = 0;
mediaPlayer.CurrentPosition = indexPositionInSeconds;
mediaPlayer.RefreshProgressBar();
}
}