OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 7 Jan 2009 19:16:33 +0000 (19:16 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 7 Jan 2009 19:16:33 +0000 (19:16 +0000)
- Check the encoded sample actually exists before trying to play it in VLC!

git-svn-id: svn://localhost/HandBrake/trunk@2067 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/frmGenPreview.cs

index 0bc59e0..1731a63 100644 (file)
@@ -35,21 +35,23 @@ namespace Handbrake
             currently_playing = "";\r
             if (mainWindow.text_destination.Text != "")\r
                 currently_playing = mainWindow.text_destination.Text.Replace(".m", "_sample.m").Replace(".avi", "_sample.avi").Replace(".ogm", "_sample.ogm");\r
-            \r
+\r
             // Launch VLC and play video.\r
             if (currently_playing != "")\r
             {\r
-                if (File.Exists(Properties.Settings.Default.VLC_Path))\r
-                {\r
-                    String args = "\"" + currently_playing + "\"";\r
-                    ProcessStartInfo vlc = new ProcessStartInfo(Properties.Settings.Default.VLC_Path, args);\r
-                    Process.Start(vlc);\r
-                    lbl_status.Text = "VLC will now launch.";\r
-                }\r
-                else\r
+                if (File.Exists(currently_playing))\r
                 {\r
-                    MessageBox.Show("Unable to detect VLC Player. \nPlease make sure VLC is installed and the directory specified in the program options is correct.", "VLC", MessageBoxButtons.OK, MessageBoxIcon.Information);\r
-                }\r
+                    if (File.Exists(Properties.Settings.Default.VLC_Path))\r
+                    {\r
+                        String args = "\"" + currently_playing + "\"";\r
+                        ProcessStartInfo vlc = new ProcessStartInfo(Properties.Settings.Default.VLC_Path, args);\r
+                        Process.Start(vlc);\r
+                        lbl_status.Text = "VLC will now launch.";\r
+                    }\r
+                    else\r
+                        MessageBox.Show("Unable to detect VLC Player. \nPlease make sure VLC is installed and the directory specified in the program options is correct.", "VLC", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+                } else\r
+                    MessageBox.Show("Unable to find the preview file. Either the file was deleted or the encode failed. Check the activity log for details.", "VLC", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
             }\r
         }\r
 \r