OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / win / C# / frmPreview.cs
index f38ee5c..f2356ae 100644 (file)
@@ -19,7 +19,6 @@ namespace Handbrake
         private delegate void UpdateUIHandler();\r
         String currently_playing = "";\r
         readonly frmMain mainWindow;\r
-        private Process hbProc;\r
         private Thread player;\r
         private Boolean noQT;\r
 \r
@@ -84,13 +83,16 @@ namespace Handbrake
         private void procMonitor(object state)\r
         {\r
             // Make sure we are not already encoding and if we are then display an error.\r
-            if (hbProc != null)\r
+            if (process.hbProcess != null)\r
                 MessageBox.Show(this, "Handbrake is already encoding a video!", "Status", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
             else\r
             {\r
-                hbProc = process.runCli((string)state).hbProcProcess;\r
-                hbProc.WaitForExit();\r
-                hbProc = null;\r
+                process.runCli((string)state);\r
+                if (process.hbProcess != null)\r
+                {\r
+                    process.hbProcess.WaitForExit();\r
+                    process.hbProcess = null;\r
+                }\r
                 encodeCompleted();\r
             }\r
         }\r