From 5c1229b171891286c4d4f1c0eaeb0b2ef408c591 Mon Sep 17 00:00:00 2001 From: lay295 Date: Fri, 15 Jan 2021 21:51:06 -0500 Subject: [PATCH] Revert "Set InvariantCulture for VOD times" This reverts commit db5b81aaffd67573beb255b8e296f11cb1676759. --- .../TwitchDownloaderCore.csproj | 2 +- TwitchDownloaderCore/VideoDownloader.cs | 30 +++++++++---------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/TwitchDownloaderCore/TwitchDownloaderCore.csproj b/TwitchDownloaderCore/TwitchDownloaderCore.csproj index 3a7a98fa..8ed82fd2 100644 --- a/TwitchDownloaderCore/TwitchDownloaderCore.csproj +++ b/TwitchDownloaderCore/TwitchDownloaderCore.csproj @@ -6,7 +6,7 @@ false MIT Lewis Pardo - 1.0.8 + 1.0.7 diff --git a/TwitchDownloaderCore/VideoDownloader.cs b/TwitchDownloaderCore/VideoDownloader.cs index b2112701..0c2a5645 100644 --- a/TwitchDownloaderCore/VideoDownloader.cs +++ b/TwitchDownloaderCore/VideoDownloader.cs @@ -207,28 +207,26 @@ await Task.Run(() => await Task.Run(() => { - progress.Report(new ProgressReport() { reportType = ReportType.Log, data = "Ffmpeg Path: " + downloadOptions.FfmpegPath }); - progress.Report(new ProgressReport() { reportType = ReportType.Log, data = "Input File: " + Path.Combine(downloadFolder, "output.ts") }); - progress.Report(new ProgressReport() { reportType = ReportType.Log, data = "Output File: " + Path.GetFullPath(downloadOptions.Filename) }); - var process = new Process + try { - StartInfo = + var process = new Process + { + StartInfo = { FileName = downloadOptions.FfmpegPath, - Arguments = String.Format("-y -avoid_negative_ts make_zero " + (downloadOptions.CropBeginning ? "-ss {1} " : "") + "-i \"{0}\" -analyzeduration {2} -probesize {2} " + (downloadOptions.CropEnding ? "-t {3} " : "") + "-c:v copy \"{4}\"", Path.Combine(downloadFolder, "output.ts"), (seekTime - startOffset).ToString(CultureInfo.InvariantCulture), Int32.MaxValue, seekDuration.ToString(CultureInfo.InvariantCulture), Path.GetFullPath(downloadOptions.Filename)), + Arguments = String.Format("-y -avoid_negative_ts make_zero " + (downloadOptions.CropBeginning ? "-ss {1} " : "") + "-i \"{0}\" -analyzeduration {2} -probesize {2} " + (downloadOptions.CropEnding ? "-t {3} " : "") + "-c:v copy \"{4}\"", Path.Combine(downloadFolder, "output.ts"), (seekTime - startOffset).ToString(), Int32.MaxValue, seekDuration.ToString(), Path.GetFullPath(downloadOptions.Filename)), UseShellExecute = false, CreateNoWindow = true, - RedirectStandardInput = true, - RedirectStandardOutput = true, - RedirectStandardError = true + RedirectStandardInput = false, + RedirectStandardOutput = false, + RedirectStandardError = false } - }; - process.ErrorDataReceived += ((object sender, DataReceivedEventArgs e) => { progress.Report(new ProgressReport() { reportType = ReportType.Log, data = e.Data }); }); - - process.Start(); - process.BeginErrorReadLine(); - process.BeginOutputReadLine(); - process.WaitForExit(); + }; + process.Start(); + process.WaitForExit(); + } + catch (TaskCanceledException) { } + Cleanup(downloadFolder); }); } catch