From d3d2c2804f80717d54960ab05ee63e8d3db42406 Mon Sep 17 00:00:00 2001 From: stax76 Date: Mon, 13 Jun 2016 20:33:30 +0200 Subject: [PATCH] - --- Controls/AviSynthListView.vb | 4 ++-- Encoding/IntelEncoder.vb | 2 +- Encoding/NVIDIAEncoder.vb | 2 +- Encoding/x264.vb | 2 +- Encoding/x265.vb | 2 +- Forms/MainForm.vb | 4 ++-- General/CommandLine.vb | 4 ++-- General/Misc.vb | 3 ++- General/Proc.vb | 16 +++++++++++++++- My Project/AssemblyInfo.vb | 2 +- StaxRip.vbproj | 1 + md/test-build.md | 1 + 12 files changed, 30 insertions(+), 13 deletions(-) diff --git a/Controls/AviSynthListView.vb b/Controls/AviSynthListView.vb index 4144e957..ee2e9923 100644 --- a/Controls/AviSynthListView.vb +++ b/Controls/AviSynthListView.vb @@ -149,9 +149,9 @@ Public Class AviSynthListView End Sub Sub OnChanged() - Log.Debug("Debug: OnChanged IsLoading", IsLoading.ToString) + Log.Debug("Debug: OnChanged IsLoading", IsLoading.ToString, "eac3to") If IsLoading Then Exit Sub - Log.Debug("Debug", "OnChanged after IsLoading") + Log.Debug("Debug", "OnChanged after IsLoading", "eac3to") Load() RaiseEvent Changed() End Sub diff --git a/Encoding/IntelEncoder.vb b/Encoding/IntelEncoder.vb index 5eb34275..a9aa7082 100644 --- a/Encoding/IntelEncoder.vb +++ b/Encoding/IntelEncoder.vb @@ -79,7 +79,7 @@ Public Class IntelEncoder Using proc As New Proc proc.Init("Encoding using QSVEncC " + Package.QSVEncC.Version) - proc.Encoding = Proc.BatchEncoding + proc.Encoding = Proc.ProcessEncoding proc.SkipStrings = {" frames: "} proc.WriteLine(batchCode + BR2) proc.File = "cmd.exe" diff --git a/Encoding/NVIDIAEncoder.vb b/Encoding/NVIDIAEncoder.vb index bec91c73..c6ceb49c 100644 --- a/Encoding/NVIDIAEncoder.vb +++ b/Encoding/NVIDIAEncoder.vb @@ -74,7 +74,7 @@ Public Class NVIDIAEncoder Using proc As New Proc proc.Init("Encoding using NVEncC " + Package.NVEncC.Version) - proc.Encoding = Proc.BatchEncoding + proc.Encoding = Proc.ProcessEncoding proc.SkipStrings = {"%]", " frames: "} proc.WriteLine(batchCode + BR2) proc.File = "cmd.exe" diff --git a/Encoding/x264.vb b/Encoding/x264.vb index a2550531..da0e02e3 100644 --- a/Encoding/x264.vb +++ b/Encoding/x264.vb @@ -56,7 +56,7 @@ Public Class x264Encoder Using proc As New Proc proc.Init(passName) - proc.Encoding = Proc.BatchEncoding + proc.Encoding = Proc.ProcessEncoding proc.Priority = priority proc.SkipStrings = {"kb/s, eta", "%]"} proc.WriteLine(batchCode + BR2) diff --git a/Encoding/x265.vb b/Encoding/x265.vb index 58e94a4a..1b5a1eec 100644 --- a/Encoding/x265.vb +++ b/Encoding/x265.vb @@ -66,7 +66,7 @@ Public Class x265Encoder Using proc As New Proc proc.Init(passName) - proc.Encoding = Proc.BatchEncoding + proc.Encoding = Encoding.UTF8 proc.Priority = priority proc.SkipStrings = {"%] "} proc.WriteLine(batchCode + BR2) diff --git a/Forms/MainForm.vb b/Forms/MainForm.vb index 3d022c68..ceb81682 100644 --- a/Forms/MainForm.vb +++ b/Forms/MainForm.vb @@ -1595,13 +1595,13 @@ Public Class MainForm End If End If - Log.Debug("Debug", "before SetFilter") + Log.Debug("Debug", "before SetFilter", "eac3to") p.Script.SetFilter(preferredSourceFilter.Category, preferredSourceFilter.Name, preferredSourceFilter.Script) - Log.Debug("Debug", "after SetFilter") + Log.Debug("Debug", "after SetFilter", "eac3to") End If If Not g.VerifyRequirements() Then Throw New AbortException diff --git a/General/CommandLine.vb b/General/CommandLine.vb index 7df07f7d..93e29379 100644 --- a/General/CommandLine.vb +++ b/General/CommandLine.vb @@ -41,8 +41,8 @@ Namespace CommandLine File.WriteAllText(batchPath, batchCode, Proc.BatchEncoding) Dim batchProc As New Process - batchProc.StartInfo.StandardErrorEncoding = Proc.BatchEncoding - batchProc.StartInfo.StandardOutputEncoding = Proc.BatchEncoding + batchProc.StartInfo.StandardErrorEncoding = Proc.ProcessEncoding + batchProc.StartInfo.StandardOutputEncoding = Proc.ProcessEncoding batchProc.StartInfo.FileName = "cmd.exe" batchProc.StartInfo.Arguments = "/k """ + batchPath + """" batchProc.StartInfo.WorkingDirectory = p.TempDir diff --git a/General/Misc.vb b/General/Misc.vb index 2ab7ade7..dbad1476 100644 --- a/General/Misc.vb +++ b/General/Misc.vb @@ -971,7 +971,8 @@ Class Log End Sub 'TODO: hide when bug is found - Shared Sub Debug(title As String, value As String) + Shared Sub Debug(title As String, value As String, Optional requiredContent As String = Nothing) + If requiredContent <> "" AndAlso Not p.Log.ToString.Contains(requiredContent) Then Exit Sub Write(title, value) End Sub diff --git a/General/Proc.vb b/General/Proc.vb index 6e6d7ebe..e77d5b26 100644 --- a/General/Proc.vb +++ b/General/Proc.vb @@ -54,7 +54,11 @@ Class Proc Shared ReadOnly Property BatchHeader As String Get 'unicode don't work on Windows 7 - If p.SourceFile.ContainsUnicode Then Return "@echo off" + BR + "CHCP 65001" + BR + If p.SourceFile.ContainsUnicode Then + Return "@echo off" + BR + "CHCP 65001" + BR + Else + Return "@echo off" + BR + End If End Get End Property @@ -62,6 +66,16 @@ Class Proc Get 'unicode don't work on Windows 7 If p.SourceFile.ContainsUnicode Then Return New UTF8Encoding(False) + Else + Return Encoding.GetEncoding(850) + End If + End Get + End Property + + Shared ReadOnly Property ProcessEncoding As Encoding + Get 'unicode don't work on Windows 7 + If p.SourceFile.ContainsUnicode Then + Return Encoding.UTF8 Else Return Encoding.Default End If diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 1c420879..92ccf8d1 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -8,4 +8,4 @@ Imports System.Runtime.InteropServices - \ No newline at end of file + \ No newline at end of file diff --git a/StaxRip.vbproj b/StaxRip.vbproj index d4b27e15..95c3b7eb 100644 --- a/StaxRip.vbproj +++ b/StaxRip.vbproj @@ -123,6 +123,7 @@ packages\Microsoft.CodeAnalysis.Scripting.Common.1.2.1\lib\dotnet\Microsoft.CodeAnalysis.Scripting.dll True + Microsoft.VisualBasic diff --git a/md/test-build.md b/md/test-build.md index cfb7ab14..f9f41f10 100644 --- a/md/test-build.md +++ b/md/test-build.md @@ -17,6 +17,7 @@ https://onedrive.live.com/redir?resid=604D4754F64B0ABC!4140&authkey=!ANUm9V3vTPm - fixed the check for enough free space on the disk of the target file, instead of three times the source file one time is now enough - fixed crash StaxRip checking for enough free space in file batch mode and if target directory is network share - fixed Umlaute don't work on Windows 7 +- fixed many avs/vs scripts are created when the target file name is changed by typing #### Tweaks