summaryrefslogtreecommitdiffstats
path: root/win/C#/Functions
diff options
context:
space:
mode:
Diffstat (limited to 'win/C#/Functions')
-rw-r--r--win/C#/Functions/Encode.cs1
-rw-r--r--win/C#/Functions/Main.cs23
2 files changed, 22 insertions, 2 deletions
diff --git a/win/C#/Functions/Encode.cs b/win/C#/Functions/Encode.cs
index b6a4a0a43..3f126d7e5 100644
--- a/win/C#/Functions/Encode.cs
+++ b/win/C#/Functions/Encode.cs
@@ -136,6 +136,7 @@ namespace Handbrake.Functions
/// if this feature is enabled in options.
/// </summary>
/// <param name="query"></param>
+ /// <param name="destination"></param>
public void copyLog(string query, string destination)
{
// The user may wish to do something with the log.
diff --git a/win/C#/Functions/Main.cs b/win/C#/Functions/Main.cs
index 05bb00f56..af0ce7f72 100644
--- a/win/C#/Functions/Main.cs
+++ b/win/C#/Functions/Main.cs
@@ -173,7 +173,7 @@ namespace Handbrake.Functions
data_chpt.Rows[n].Cells[1].ValueType = typeof(string);
i++;
}
-
+
return data_chpt;
}
@@ -324,7 +324,7 @@ namespace Handbrake.Functions
if (line == null) line = "";
Match m = Regex.Match(line, @"HandBrake ([0-9\.]*)*(svn[0-9]*[M]*)* \([0-9]*\)");
- if (m.Success != false)
+ if (m.Success)
{
string data = line.Replace("(", "").Replace(")", "").Replace("HandBrake ", "");
string[] arr = data.Split(' ');
@@ -332,6 +332,9 @@ namespace Handbrake.Functions
cliVersionData.Add(arr[1]);
return cliVersionData;
}
+ if (cliProcess.TotalProcessorTime.Seconds > 10) // Don't wait longer than 10 seconds.
+ killCLI();
+
}
}
catch (Exception e)
@@ -343,6 +346,22 @@ namespace Handbrake.Functions
cliVersionData.Add("0");
return cliVersionData;
}
+ private void killCLI()
+ {
+ string AppName = "HandBrakeCLI";
+ AppName = AppName.ToUpper();
+
+ System.Diagnostics.Process[] prs = Process.GetProcesses();
+ foreach (System.Diagnostics.Process proces in prs)
+ {
+ if (proces.ProcessName.ToUpper() == AppName)
+ {
+ proces.Refresh();
+ if (!proces.HasExited)
+ proces.Kill();
+ }
+ }
+ }
/// <summary>
/// Check if the queue recovery file contains records.