diff options
Diffstat (limited to 'win/C#/Functions')
-rw-r--r-- | win/C#/Functions/Encode.cs | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/win/C#/Functions/Encode.cs b/win/C#/Functions/Encode.cs index a6bfd263a..d5c6577e5 100644 --- a/win/C#/Functions/Encode.cs +++ b/win/C#/Functions/Encode.cs @@ -49,27 +49,31 @@ namespace Handbrake.Functions isEncoding = true;
currentQuery = query;
- // Set the process Priority
- if (hbProc != null)
+ // Set the process Priority
+ Process hbCliProcess = null;
+ if (processID != -1)
+ hbCliProcess = Process.GetProcessById(processID);
+
+ if (hbCliProcess != null)
switch (Properties.Settings.Default.processPriority)
{
case "Realtime":
- hbProc.PriorityClass = ProcessPriorityClass.RealTime;
+ hbCliProcess.PriorityClass = ProcessPriorityClass.RealTime;
break;
case "High":
- hbProc.PriorityClass = ProcessPriorityClass.High;
+ hbCliProcess.PriorityClass = ProcessPriorityClass.High;
break;
case "Above Normal":
- hbProc.PriorityClass = ProcessPriorityClass.AboveNormal;
+ hbCliProcess.PriorityClass = ProcessPriorityClass.AboveNormal;
break;
case "Normal":
- hbProc.PriorityClass = ProcessPriorityClass.Normal;
+ hbCliProcess.PriorityClass = ProcessPriorityClass.Normal;
break;
case "Low":
- hbProc.PriorityClass = ProcessPriorityClass.Idle;
+ hbCliProcess.PriorityClass = ProcessPriorityClass.Idle;
break;
default:
- hbProc.PriorityClass = ProcessPriorityClass.BelowNormal;
+ hbCliProcess.PriorityClass = ProcessPriorityClass.BelowNormal;
break;
}
}
|