summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Services/Encode.cs
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Services/Encode.cs')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Encode.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode.cs
index 8c04d5a3b..7553456d5 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/Encode.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/Encode.cs
@@ -21,6 +21,7 @@ namespace HandBrake.ApplicationServices.Services
using HandBrake.ApplicationServices.Parsing;
using HandBrake.ApplicationServices.Services.Base;
using HandBrake.ApplicationServices.Services.Interfaces;
+ using HandBrake.ApplicationServices.Utilities;
/// <summary>
/// Class which handles the CLI
@@ -120,7 +121,16 @@ namespace HandBrake.ApplicationServices.Services
this.VerifyEncodeDestinationPath(currentTask);
string handbrakeCLIPath = Path.Combine(Application.StartupPath, "HandBrakeCLI.exe");
- ProcessStartInfo cliStart = new ProcessStartInfo(handbrakeCLIPath, currentTask.Query)
+
+ // TODO tidy this code up, it's kinda messy.
+ string query = this.currentTask.Task.IsPreviewEncode
+ ? QueryGeneratorUtility.GeneratePreviewQuery(
+ new EncodeTask(this.currentTask.Task),
+ this.currentTask.Task.PreviewEncodeDuration,
+ this.currentTask.Task.PreviewEncodeStartAt)
+ : QueryGeneratorUtility.GenerateQuery(new EncodeTask(this.currentTask.Task));
+
+ ProcessStartInfo cliStart = new ProcessStartInfo(handbrakeCLIPath, query)
{
RedirectStandardOutput = true,
RedirectStandardError = enableLogging ? true : false,