summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsr55 <[email protected]>2011-09-12 20:09:55 +0000
committersr55 <[email protected]>2011-09-12 20:09:55 +0000
commitace57e1b754f84cad9603e7ed14aa9c6bb705461 (patch)
tree3b5276d7b4372a4a36a7d57da829da4db0eb34f9
parent7129aebff7254512f7319b059c507db6f9c77ca2 (diff)
WinGui: Numerous fixes to Libhb based scanning and encoding. Aside from several non-critical bugs, the code is now "usable" but should be considered experimental.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4219 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--win/CS/Controls/Filters.cs2
-rw-r--r--win/CS/HandBrake.ApplicationServices/Functions/InteropModelCreator.cs2
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs1
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/LibEncode.cs15
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/LibScan.cs11
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/ScanService.cs4
6 files changed, 24 insertions, 11 deletions
diff --git a/win/CS/Controls/Filters.cs b/win/CS/Controls/Filters.cs
index 698077f35..967df4e7d 100644
--- a/win/CS/Controls/Filters.cs
+++ b/win/CS/Controls/Filters.cs
@@ -132,7 +132,7 @@ namespace Handbrake.Controls
{
get
{
- return slider_deblock.Value;
+ return this.slider_deblock.Value != 4 ? this.slider_deblock.Value : 0;
}
}
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);