diff --git a/src/ui/Forms/AudioToText/WhisperAudioToText.cs b/src/ui/Forms/AudioToText/WhisperAudioToText.cs index 5e4f04210..61ad8aafd 100644 --- a/src/ui/Forms/AudioToText/WhisperAudioToText.cs +++ b/src/ui/Forms/AudioToText/WhisperAudioToText.cs @@ -48,7 +48,6 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText public bool IncompleteModel { get; set; } public string IncompleteModelName { get; set; } - private static bool? _cudaNoDevice { get; set; } private static bool? _cudaSomeDevice { get; set; } public Subtitle TranscribedSubtitle { get; private set; } @@ -1752,16 +1751,12 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText private static void OutputHandlerCheckCuda(object sendingProcess, DataReceivedEventArgs outLine) { - if (string.IsNullOrWhiteSpace(outLine.Data)) + if (string.IsNullOrEmpty(outLine.Data)) { return; } - if (outLine.Data.Contains("CUDA device: 0")) - { - _cudaNoDevice = true; - } - else if (outLine.Data.Contains("CUDA device:")) + if (!outLine.Data.Contains("CUDA device: 0") && outLine.Data.Contains("CUDA device:")) { _cudaSomeDevice = true; } diff --git a/src/ui/Forms/BinaryEdit/BinEdit.cs b/src/ui/Forms/BinaryEdit/BinEdit.cs index 1c0f7e8dd..0d9b41b46 100644 --- a/src/ui/Forms/BinaryEdit/BinEdit.cs +++ b/src/ui/Forms/BinaryEdit/BinEdit.cs @@ -429,8 +429,8 @@ namespace Nikse.SubtitleEdit.Forms.BinaryEdit FillListView(_subtitle); found = true; } - - + + if (!found && (ext == ".mkv" || ext == ".mks")) { if (!OpenMatroskaFile(fileName)) @@ -550,7 +550,7 @@ namespace Nikse.SubtitleEdit.Forms.BinaryEdit found = true; } } - + if (!found && FileUtil.IsManzanita(fileName)) { if (!ImportSubtitleFromManzanitaTransportStream(fileName)) @@ -2817,8 +2817,7 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine + if (!e.Cancel) { - e.Cancel = true; - + e.Cancel = true; // Hack as FormClosing will crash if any Forms are created here (e.g. a msgbox). _forceClose = true; _dialogResult = DialogResult; SynchronizationContext.Current.Post(TimeSpan.FromMilliseconds(10), () => diff --git a/src/ui/Forms/Main.cs b/src/ui/Forms/Main.cs index 632330c06..0b77f085e 100644 --- a/src/ui/Forms/Main.cs +++ b/src/ui/Forms/Main.cs @@ -13242,9 +13242,8 @@ namespace Nikse.SubtitleEdit.Forms if (!e.Cancel) { - e.Cancel = true; + e.Cancel = true; // Hack as FormClosing will crash if any Forms are created here (e.g. a msgbox). _forceClose = true; - // To allow windows in FormClosing... SynchronizationContext.Current.Post(TimeSpan.FromMilliseconds(10), () => Application.Exit()); } } diff --git a/src/ui/Forms/Ocr/VobSubOcr.cs b/src/ui/Forms/Ocr/VobSubOcr.cs index b2502c704..4ab00443d 100644 --- a/src/ui/Forms/Ocr/VobSubOcr.cs +++ b/src/ui/Forms/Ocr/VobSubOcr.cs @@ -8229,9 +8229,7 @@ namespace Nikse.SubtitleEdit.Forms.Ocr if (!e.Cancel) { - e.Cancel = true; - - // To allow windows in FormClosing... + e.Cancel = true; // Hack as FormClosing will crash if any Forms are created here (e.g. a msgbox). _forceClose = true; _dialogResult = DialogResult; System.Threading.SynchronizationContext.Current.Post(TimeSpan.FromMilliseconds(10), () => diff --git a/src/ui/Forms/VisualSync.cs b/src/ui/Forms/VisualSync.cs index 8d0535d30..5df161c6c 100644 --- a/src/ui/Forms/VisualSync.cs +++ b/src/ui/Forms/VisualSync.cs @@ -333,9 +333,7 @@ namespace Nikse.SubtitleEdit.Forms if (!e.Cancel) { - e.Cancel = true; - - _forceClose = true; + e.Cancel = true; // Hack as FormClosing will crash if any Forms are created here (e.g. a msgbox). _forceClose = true; _dialogResult = DialogResult; System.Threading.SynchronizationContext.Current.Post(TimeSpan.FromMilliseconds(10), () => {