diff options
author | sr55 <[email protected]> | 2015-01-19 21:00:04 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2015-01-19 21:00:04 +0000 |
commit | e92de31ae2e15317e95c5ecf13a2105916348881 (patch) | |
tree | 3267a6332b0f90b1e74dce8dd4b39d12f5fa34d2 /win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs | |
parent | 03806044c2982cf163b758a5205bef49777dfc26 (diff) |
WinGui: Adding additional logging around LibHB scan / encode to track down why it's not starting for some users.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6774 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs')
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs index 215b05e02..516be8932 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs @@ -136,10 +136,12 @@ namespace HandBrake.ApplicationServices.Services.Encode HandBrakeUtils.SetDvdNav(!job.Configuration.IsDvdNavDisabled);
+ ServiceLogMessage("Scanning title for encoding ... ");
this.instance.StartScan(job.Task.Source, job.Configuration.PreviewScanCount, job.Task.Title);
}
catch (Exception exc)
{
+ ServiceLogMessage("Scan Failed ... " + Environment.NewLine + exc);
this.InvokeEncodeCompleted(new EventArgs.EncodeCompletedEventArgs(false, exc, "An Error has occured.", this.currentTask.Task.Destination));
}
}
@@ -152,6 +154,7 @@ namespace HandBrake.ApplicationServices.Services.Encode if (this.instance != null)
{
this.instance.PauseEncode();
+ ServiceLogMessage("Encode Paused");
this.IsPasued = true;
}
}
@@ -164,6 +167,7 @@ namespace HandBrake.ApplicationServices.Services.Encode if (this.instance != null)
{
this.instance.ResumeEncode();
+ ServiceLogMessage("Encode Resumed");
this.IsPasued = false;
}
}
@@ -177,6 +181,7 @@ namespace HandBrake.ApplicationServices.Services.Encode {
this.IsEncoding = false;
this.instance.StopEncode();
+ ServiceLogMessage("Encode Stopped");
}
catch (Exception)
{
@@ -203,6 +208,8 @@ namespace HandBrake.ApplicationServices.Services.Encode /// </param>
private void ScanCompleted(QueueTask job, IHandBrakeInstance instance)
{
+ ServiceLogMessage("Scan Completed. Setting up the job for encoding ...");
+
// Get an EncodeJob object for the Interop Library
EncodeJob encodeJob = InteropModelCreator.GetEncodeJob(job);
@@ -210,6 +217,7 @@ namespace HandBrake.ApplicationServices.Services.Encode Title title = this.scannedSource.Titles.FirstOrDefault(t => t.TitleNumber == job.Task.Title);
if (title == null)
{
+ ServiceLogMessage("Title not found.");
throw new Exception("Unable to get title for encoding. Encode Failed.");
}
@@ -222,7 +230,16 @@ namespace HandBrake.ApplicationServices.Services.Encode };
// TODO fix this tempory hack to pass in the required title information into the factory.
- instance.StartEncode(encodeJob, scannedTitle, job.Configuration.PreviewScanCount);
+ try
+ {
+ ServiceLogMessage("Starting Encode ...");
+ instance.StartEncode(encodeJob, scannedTitle, job.Configuration.PreviewScanCount);
+ }
+ catch (Exception exc)
+ {
+ ServiceLogMessage("Failed to start encoding ..." + Environment.NewLine + exc);
+ this.InvokeEncodeCompleted(new EventArgs.EncodeCompletedEventArgs(false, exc, "Unable to start encoding", job.Task.Source));
+ }
// Fire the Encode Started Event
this.InvokeEncodeStarted(System.EventArgs.Empty);
@@ -323,6 +340,7 @@ namespace HandBrake.ApplicationServices.Services.Encode private void InstanceEncodeCompleted(object sender, EncodeCompletedEventArgs e)
{
this.IsEncoding = false;
+ ServiceLogMessage("Encode Completed ...");
this.InvokeEncodeCompleted(
e.Error
|