Tried to fix error when closing video before it loads completely - thx XhmikosR :)

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@1952 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2013-07-28 14:11:04 +00:00
parent 071c77d147
commit e7ca8ffd09
2 changed files with 19 additions and 5 deletions

View File

@ -13559,10 +13559,14 @@ namespace Nikse.SubtitleEdit.Forms
private void toolStripComboBoxWaveForm_SelectedIndexChanged(object sender, EventArgs e)
{
ComboBoxZoomItem item = toolStripComboBoxWaveForm.SelectedItem as ComboBoxZoomItem;
if (item != null)
try
{
audioVisualizer.ZoomFactor = item.ZoomFactor;
ComboBoxZoomItem item = toolStripComboBoxWaveForm.SelectedItem as ComboBoxZoomItem;
if (item != null)
audioVisualizer.ZoomFactor = item.ZoomFactor;
}
catch
{
}
}

View File

@ -61,7 +61,17 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
public override double Duration
{
get { return _mediaPosition.Duration; }
get
{
try
{
return _mediaPosition.Duration;
}
catch
{
return 0;
}
}
}
public override double CurrentPosition
@ -236,7 +246,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
if (_isPaused == false && _quartzFilgraphManager != null && CurrentPosition >= Duration)
{
_isPaused = true;
if (OnVideoEnded != null)
if (OnVideoEnded != null && _quartzFilgraphManager != null)
OnVideoEnded.Invoke(_quartzFilgraphManager, new EventArgs());
}
}