summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2017-10-29 21:16:33 +0000
committersr55 <[email protected]>2017-10-29 21:16:33 +0000
commitc1cdfa404cfe0262717903b40f64a53122b992cb (patch)
treea117d112b18c3c593c47b1b514478bdb916a7e15 /win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs
parent77ab4c5266f7cd810685e3d544a2c43644cba8d1 (diff)
WinGui: Don't perform Foreign Audio Subtitle Scans for short video previews. The long wait to scan an entire source is not valuable for short video previews. #877
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs
index 55045cbca..7359d2fd6 100644
--- a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs
@@ -14,6 +14,7 @@ namespace HandBrakeWPF.ViewModels
using System.Diagnostics;
using System.Globalization;
using System.IO;
+ using System.Linq;
using System.Runtime.ExceptionServices;
using System.Threading;
using System.Windows;
@@ -23,6 +24,7 @@ namespace HandBrakeWPF.ViewModels
using HandBrakeWPF.Factories;
using HandBrakeWPF.Properties;
+ using HandBrakeWPF.Services.Encode.Model.Models;
using HandBrakeWPF.Services.Interfaces;
using HandBrakeWPF.Services.Queue.Model;
using HandBrakeWPF.Services.Scan.Interfaces;
@@ -560,6 +562,22 @@ namespace HandBrakeWPF.ViewModels
encodeTask.IsPreviewEncode = true;
encodeTask.PreviewEncodeStartAt = this.SelectedPreviewImage + 1;
encodeTask.PreviewEncodeDuration = this.Duration;
+
+ SubtitleTrack scanTrack = null;
+ foreach (var track in encodeTask.SubtitleTracks)
+ {
+ if (track.SourceTrack != null && track.SourceTrack.SubtitleType == SubtitleType.ForeignAudioSearch)
+ {
+ scanTrack = track;
+ break;
+ }
+ }
+
+ if (scanTrack != null)
+ {
+ encodeTask.SubtitleTracks.Remove(scanTrack);
+ }
+
QueueTask task = new QueueTask(encodeTask, HBConfigurationFactory.Create(), this.ScannedSource.ScanPath);
ThreadPool.QueueUserWorkItem(this.CreatePreview, task);
}