diff options
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices')
5 files changed, 23 insertions, 10 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Functions/InteropModelCreator.cs b/win/CS/HandBrake.ApplicationServices/Functions/InteropModelCreator.cs index 62fe16120..6221b5784 100644 --- a/win/CS/HandBrake.ApplicationServices/Functions/InteropModelCreator.cs +++ b/win/CS/HandBrake.ApplicationServices/Functions/InteropModelCreator.cs @@ -85,7 +85,7 @@ namespace HandBrake.ApplicationServices.Functions Right = work.Cropping.Right
};
- profile.CustomCropping = true;
+ profile.CustomCropping = true; // TODO deal with this better
profile.CustomDecomb = work.CustomDecomb;
profile.CustomDeinterlace = work.CustomDeinterlace;
profile.CustomDenoise = work.CustomDenoise;
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs b/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs index f88e7a06e..0c8d97c53 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs @@ -241,6 +241,7 @@ namespace HandBrake.ApplicationServices.Services.Base /// </param>
protected void SetupLogging(QueueTask encodeQueueTask)
{
+ ShutdownFileWriter();
string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";
string logFile = Path.Combine(logDir, string.Format("last_encode_log{0}.txt", GeneralUtilities.GetInstanceCount));
string logFile2 = Path.Combine(logDir, string.Format("tmp_appReadable_log{0}.txt", GeneralUtilities.GetInstanceCount));
diff --git a/win/CS/HandBrake.ApplicationServices/Services/LibEncode.cs b/win/CS/HandBrake.ApplicationServices/Services/LibEncode.cs index 99e8be748..d99bdbec8 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/LibEncode.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/LibEncode.cs @@ -87,7 +87,7 @@ namespace HandBrake.ApplicationServices.Services // Sanity Checking and Setup
if (this.IsEncoding)
{
- throw new Exception("HandBrake is already encodeing.");
+ throw new Exception("HandBrake is already encoding.");
}
this.IsEncoding = true;
@@ -204,7 +204,7 @@ namespace HandBrake.ApplicationServices.Services {
lock (logLock)
{
- this.LogBuffer.AppendLine(e.Message);
+ this.ProcessLogMessage(e.Message);
}
}
}
@@ -224,7 +224,7 @@ namespace HandBrake.ApplicationServices.Services {
lock (logLock)
{
- this.LogBuffer.AppendLine(e.Message);
+ this.ProcessLogMessage(e.Message);
}
}
}
@@ -245,7 +245,7 @@ namespace HandBrake.ApplicationServices.Services AverageFrameRate = e.AverageFrameRate,
CurrentFrameRate = e.CurrentFrameRate,
EstimatedTimeLeft = e.EstimatedTimeLeft,
- PercentComplete = e.FractionComplete,
+ PercentComplete = e.FractionComplete * 100,
Task = e.Pass,
ElapsedTime = DateTime.Now - this.startTime,
};
@@ -274,7 +274,10 @@ namespace HandBrake.ApplicationServices.Services {
this.IsEncoding = false;
- this.Invoke_encodeCompleted(new EncodeCompletedEventArgs(e.Error, null, string.Empty));
+ this.Invoke_encodeCompleted(
+ e.Error
+ ? new EncodeCompletedEventArgs(false, null, string.Empty)
+ : new EncodeCompletedEventArgs(true, null, string.Empty));
if (this.WindowsSeven.IsWindowsSeven)
{
@@ -285,6 +288,8 @@ namespace HandBrake.ApplicationServices.Services {
Win32.AllowSleep();
}
+
+ this.ShutdownFileWriter();
}
#endregion
}
diff --git a/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs b/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs index 3e2e166ce..1dab6aa6c 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs @@ -14,8 +14,8 @@ namespace HandBrake.ApplicationServices.Services using HandBrake.ApplicationServices.Model.Encoding;
using HandBrake.ApplicationServices.Parsing;
using HandBrake.ApplicationServices.Services.Interfaces;
+ using HandBrake.ApplicationServices.Utilities;
using HandBrake.Interop;
- using HandBrake.Interop.Model;
using AudioTrack = HandBrake.ApplicationServices.Parsing.Audio;
using ScanProgressEventArgs = HandBrake.Interop.ScanProgressEventArgs;
@@ -85,6 +85,11 @@ namespace HandBrake.ApplicationServices.Services /// </summary>
public event ScanProgessStatus ScanStatusChanged;
+ /// <summary>
+ /// The Log File Header
+ /// </summary>
+ StringBuilder header = GeneralUtilities.CreateCliLogHeader();
+
#endregion
#region Properties
@@ -106,7 +111,7 @@ namespace HandBrake.ApplicationServices.Services {
get
{
- return logging.ToString();
+ return string.IsNullOrEmpty(this.logging.ToString()) ? this.header + "No log data available..." : this.header + this.logging.ToString();
}
}
@@ -161,6 +166,8 @@ namespace HandBrake.ApplicationServices.Services {
try
{
+ this.logging.Clear();
+
IsScanning = true;
if (this.ScanStared != null)
this.ScanStared(this, new EventArgs());
diff --git a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs index 26bfd582a..3b2543264 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs @@ -235,8 +235,8 @@ namespace HandBrake.ApplicationServices.Services // Write the Buffer out to file.
using (StreamWriter scanLog = new StreamWriter(dvdInfoPath))
{
- // Only write the log file to disk if it's less than 100MB.
- if (this.readData.Buffer.Length < 100000000)
+ // Only write the log file to disk if it's less than 50MB.
+ if (this.readData.Buffer.Length < 50000000)
{
scanLog.WriteLine(GeneralUtilities.CreateCliLogHeader());
scanLog.WriteLine(query);
|