From 9545f5c9b6c3160b0e6cba9344232cb9e1493aaf Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 25 Jan 2015 19:46:56 +0000 Subject: WinGui: Fix a object reference issue with the ScannedSource in the QueueTask object. This could lead to queue encode failures. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6815 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/HandBrake.ApplicationServices/Model/QueueTask.cs | 14 +++++++------- .../Services/Encode/LibEncode.cs | 2 +- win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 2 +- win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'win') diff --git a/win/CS/HandBrake.ApplicationServices/Model/QueueTask.cs b/win/CS/HandBrake.ApplicationServices/Model/QueueTask.cs index 2f223d97b..366f5b4e6 100644 --- a/win/CS/HandBrake.ApplicationServices/Model/QueueTask.cs +++ b/win/CS/HandBrake.ApplicationServices/Model/QueueTask.cs @@ -47,21 +47,21 @@ namespace HandBrake.ApplicationServices.Model /// /// The configuration. /// - /// - /// The scanned Source. + /// + /// The scanned Source Path. /// - public QueueTask(EncodeTask task, HBConfiguration configuration, Source scannedSource) + public QueueTask(EncodeTask task, HBConfiguration configuration, string scannedSourcePath) { this.Task = task; this.Configuration = configuration; this.Status = QueueItemStatus.Waiting; - this.ScannedSource = scannedSource; + this.ScannedSourcePath = scannedSourcePath; } /// /// Gets or sets ScannedSource. /// - public Source ScannedSource { get; set; } + public string ScannedSourcePath { get; set; } /// /// Gets or sets Status. @@ -103,7 +103,7 @@ namespace HandBrake.ApplicationServices.Model /// protected bool Equals(QueueTask other) { - return Equals(this.ScannedSource, other.ScannedSource) && Equals(this.Task, other.Task) && this.status == other.status; + return Equals(this.ScannedSourcePath, other.ScannedSourcePath) && Equals(this.Task, other.Task) && this.status == other.status; } /// @@ -145,7 +145,7 @@ namespace HandBrake.ApplicationServices.Model { unchecked { - int hashCode = (this.ScannedSource != null ? this.ScannedSource.GetHashCode() : 0); + int hashCode = (this.ScannedSourcePath != null ? this.ScannedSourcePath.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (this.Task != null ? this.Task.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (int)this.status; return hashCode; diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs index 942644f2e..42f72f509 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs @@ -138,7 +138,7 @@ namespace HandBrake.ApplicationServices.Services.Encode ServiceLogMessage("Scanning title for encoding ... "); - this.instance.StartScan(job.ScannedSource.ScanPath, job.Configuration.PreviewScanCount, job.Task.Title); + this.instance.StartScan(job.ScannedSourcePath, job.Configuration.PreviewScanCount, job.Task.Title); } catch (Exception exc) { diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 48bf428f9..6eff64259 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -1229,7 +1229,7 @@ namespace HandBrakeWPF.ViewModels return false; } - QueueTask task = new QueueTask(new EncodeTask(this.CurrentTask), HBConfigurationFactory.Create(), this.ScannedSource); + QueueTask task = new QueueTask(new EncodeTask(this.CurrentTask), HBConfigurationFactory.Create(), this.ScannedSource.ScanPath); if (!this.queueProcessor.CheckForDestinationPathDuplicates(task.Task.Destination)) { diff --git a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs index 452db5cc8..a00a3dcca 100644 --- a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs @@ -553,7 +553,7 @@ namespace HandBrakeWPF.ViewModels encodeTask.IsPreviewEncode = true; encodeTask.PreviewEncodeStartAt = this.SelectedPreviewImage; // TODO 0 and 1 mean the same. Need to fix this as it knocks the video out of sync with the still preview. encodeTask.PreviewEncodeDuration = this.Duration; - QueueTask task = new QueueTask(encodeTask, HBConfigurationFactory.Create(), this.ScannedSource); + QueueTask task = new QueueTask(encodeTask, HBConfigurationFactory.Create(), this.ScannedSource.ScanPath); ThreadPool.QueueUserWorkItem(this.CreatePreview, task); } -- cgit v1.2.3