From 71f919deb28901fccc273a0518ddbdcf70158b84 Mon Sep 17 00:00:00 2001 From: niksedk Date: Fri, 21 Jan 2011 15:33:51 +0000 Subject: [PATCH] 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 --- src/Forms/Main.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Forms/Main.cs b/src/Forms/Main.cs index a63e3308e..c814a58c9 100644 --- a/src/Forms/Main.cs +++ b/src/Forms/Main.cs @@ -1067,8 +1067,7 @@ namespace Nikse.SubtitleEdit.Forms if (!string.IsNullOrEmpty(videoFileName) && File.Exists(videoFileName)) { - OpenVideo(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;