Video volume is now zero during video load in main form

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@273 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2011-01-21 15:33:51 +00:00
parent 90d4cd3d80
commit 71f919deb2

View File

@ -1068,7 +1068,6 @@ namespace Nikse.SubtitleEdit.Forms
if (!string.IsNullOrEmpty(videoFileName) && File.Exists(videoFileName))
{
OpenVideo(videoFileName);
}
else if (!string.IsNullOrEmpty(fileName) && (toolStripButtonToogleVideo.Checked || toolStripButtonToogleWaveForm.Checked))
{
@ -6184,7 +6183,6 @@ namespace Nikse.SubtitleEdit.Forms
return false;
}
Encoding encoding;
_subtitleAlternate = new Subtitle();
_subtitleAlternateFileName = fileName;
@ -6249,7 +6247,9 @@ namespace Nikse.SubtitleEdit.Forms
VideoInfo videoInfo = ShowVideoInfo(fileName);
toolStripComboBoxFrameRate.Text = videoInfo.FramesPerSecond.ToString();
Utilities.InitializeVideoPlayerAndContainer(fileName, videoInfo, mediaPlayer, VideoLoaded, VideoEnded);
mediaPlayer.Volume = 0;
labelVideoInfo.Text = Path.GetFileName(fileName) + " " + videoInfo.Width + "x" + videoInfo.Height + " " + videoInfo.VideoCodec;
string peakWaveFileName = GetPeakWaveFileName(fileName);
@ -6272,6 +6272,7 @@ namespace Nikse.SubtitleEdit.Forms
void VideoLoaded(object sender, EventArgs e)
{
mediaPlayer.Stop();
mediaPlayer.Volume = Configuration.Settings.General.VideoPlayerDefaultVolume;
timer1.Start();
trackBarWaveFormPosition.Maximum = (int)mediaPlayer.Duration;