From 25a36bf28cd6c8880b4c9d8072c5bce151ff3511 Mon Sep 17 00:00:00 2001 From: Ivandro Ismael Date: Sun, 24 Mar 2019 16:52:46 +0000 Subject: [PATCH 1/3] mpchc: fix typo --- src/Logic/VideoPlayers/MpcHC/MpcHc.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Logic/VideoPlayers/MpcHC/MpcHc.cs b/src/Logic/VideoPlayers/MpcHC/MpcHc.cs index cb4c16d61..c542b2110 100644 --- a/src/Logic/VideoPlayers/MpcHC/MpcHc.cs +++ b/src/Logic/VideoPlayers/MpcHC/MpcHc.cs @@ -433,7 +433,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers.MpcHC public override event EventHandler OnVideoEnded; - private void ReleaseUnmangedResources() + private void ReleaseUnmanagedResources() { try { @@ -497,7 +497,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers.MpcHC } _startInfo = null; } - ReleaseUnmangedResources(); + ReleaseUnmanagedResources(); } catch (Exception exception) { From 4ae70beb381443dc53ceae6f3cf92a9348234ee8 Mon Sep 17 00:00:00 2001 From: Ivandro Ismael Date: Sun, 24 Mar 2019 16:56:29 +0000 Subject: [PATCH 2/3] mpchc: don't lock using "this" --- src/Logic/VideoPlayers/MpcHC/MpcHc.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Logic/VideoPlayers/MpcHC/MpcHc.cs b/src/Logic/VideoPlayers/MpcHC/MpcHc.cs index c542b2110..13cdeafbb 100644 --- a/src/Logic/VideoPlayers/MpcHC/MpcHc.cs +++ b/src/Logic/VideoPlayers/MpcHC/MpcHc.cs @@ -12,6 +12,8 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers.MpcHC { public class MpcHc : VideoPlayer, IDisposable { + private readonly object _locker = new object(); + private const string ModePlay = "0"; private const string ModePause = "1"; private string _playMode = string.Empty; @@ -437,7 +439,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers.MpcHC { try { - lock (this) + lock (_locker) { if (_mpcHandle != IntPtr.Zero) { From 174cc5237ec4b2feab30e1c13c4821623ffd561f Mon Sep 17 00:00:00 2001 From: Ivandro Ismael Date: Sun, 24 Mar 2019 17:43:01 +0000 Subject: [PATCH 3/3] video-player: fix typo for remaning players --- src/Logic/SpellCheck/LinuxHunspell.cs | 4 ++-- src/Logic/SpellCheck/MacHunspell.cs | 4 ++-- src/Logic/SpellCheck/VoikkoSpellCheck.cs | 4 ++-- src/Logic/VideoPlayers/LibMpvMono.cs | 4 ++-- src/Logic/VideoPlayers/LibVlcDynamic.cs | 4 ++-- src/Logic/VideoPlayers/LibVlcMono.cs | 6 +++--- src/Logic/VideoPlayers/QuartsPlayer.cs | 4 ++-- src/Logic/VideoPlayers/libMpvDynamic.cs | 4 ++-- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Logic/SpellCheck/LinuxHunspell.cs b/src/Logic/SpellCheck/LinuxHunspell.cs index c98d59702..f787a84ef 100644 --- a/src/Logic/SpellCheck/LinuxHunspell.cs +++ b/src/Logic/SpellCheck/LinuxHunspell.cs @@ -53,7 +53,7 @@ namespace Nikse.SubtitleEdit.Logic.SpellCheck Dispose(false); } - private void ReleaseUnmangedResources() + private void ReleaseUnmanagedResources() { if (_hunspellHandle != IntPtr.Zero) { @@ -74,7 +74,7 @@ namespace Nikse.SubtitleEdit.Logic.SpellCheck { //ReleaseManagedResources(); } - ReleaseUnmangedResources(); + ReleaseUnmanagedResources(); } } diff --git a/src/Logic/SpellCheck/MacHunspell.cs b/src/Logic/SpellCheck/MacHunspell.cs index 8adc8112e..c390cbff6 100644 --- a/src/Logic/SpellCheck/MacHunspell.cs +++ b/src/Logic/SpellCheck/MacHunspell.cs @@ -46,7 +46,7 @@ namespace Nikse.SubtitleEdit.Logic.SpellCheck Dispose(false); } - private void ReleaseUnmangedResources() + private void ReleaseUnmanagedResources() { if (_hunspellHandle != IntPtr.Zero) { @@ -67,7 +67,7 @@ namespace Nikse.SubtitleEdit.Logic.SpellCheck { //ReleaseManagedResources(); } - ReleaseUnmangedResources(); + ReleaseUnmanagedResources(); } } diff --git a/src/Logic/SpellCheck/VoikkoSpellCheck.cs b/src/Logic/SpellCheck/VoikkoSpellCheck.cs index 164769301..259379137 100644 --- a/src/Logic/SpellCheck/VoikkoSpellCheck.cs +++ b/src/Logic/SpellCheck/VoikkoSpellCheck.cs @@ -178,7 +178,7 @@ namespace Nikse.SubtitleEdit.Logic.SpellCheck Dispose(false); } - private void ReleaseUnmangedResources() + private void ReleaseUnmanagedResources() { try { @@ -211,7 +211,7 @@ namespace Nikse.SubtitleEdit.Logic.SpellCheck { //ReleaseManagedResources(); } - ReleaseUnmangedResources(); + ReleaseUnmanagedResources(); } } diff --git a/src/Logic/VideoPlayers/LibMpvMono.cs b/src/Logic/VideoPlayers/LibMpvMono.cs index 37ebd0101..ef047f025 100644 --- a/src/Logic/VideoPlayers/LibMpvMono.cs +++ b/src/Logic/VideoPlayers/LibMpvMono.cs @@ -331,7 +331,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers Dispose(); } - private void ReleaseUnmangedResources() + private void ReleaseUnmanagedResources() { try { @@ -374,7 +374,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers DoMpvCommand("quit"); } - ReleaseUnmangedResources(); + ReleaseUnmanagedResources(); } } diff --git a/src/Logic/VideoPlayers/LibVlcDynamic.cs b/src/Logic/VideoPlayers/LibVlcDynamic.cs index 03f9ace12..8f7387129 100644 --- a/src/Logic/VideoPlayers/LibVlcDynamic.cs +++ b/src/Logic/VideoPlayers/LibVlcDynamic.cs @@ -854,7 +854,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers public override event EventHandler OnVideoEnded; - private void ReleaseUnmangedResources() + private void ReleaseUnmanagedResources() { try { @@ -924,7 +924,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers } Application.DoEvents(); } - ReleaseUnmangedResources(); + ReleaseUnmanagedResources(); } } diff --git a/src/Logic/VideoPlayers/LibVlcMono.cs b/src/Logic/VideoPlayers/LibVlcMono.cs index c840e8169..8068cd6ac 100644 --- a/src/Logic/VideoPlayers/LibVlcMono.cs +++ b/src/Logic/VideoPlayers/LibVlcMono.cs @@ -206,7 +206,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers private void DisposeVLC(object player) { - ReleaseUnmangedResources(); + ReleaseUnmanagedResources(); } public override event EventHandler OnVideoLoaded; @@ -218,7 +218,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers Dispose(false); } - private void ReleaseUnmangedResources() + private void ReleaseUnmanagedResources() { try { @@ -262,7 +262,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers _videoEndTimer = null; } } - ReleaseUnmangedResources(); + ReleaseUnmanagedResources(); } } diff --git a/src/Logic/VideoPlayers/QuartsPlayer.cs b/src/Logic/VideoPlayers/QuartsPlayer.cs index 43ff69e0d..0c841d53c 100644 --- a/src/Logic/VideoPlayers/QuartsPlayer.cs +++ b/src/Logic/VideoPlayers/QuartsPlayer.cs @@ -294,7 +294,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers Dispose(); } - private void ReleaseUnmangedResources() + private void ReleaseUnmanagedResources() { try { @@ -345,7 +345,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers _videoLoader = null; } } - ReleaseUnmangedResources(); + ReleaseUnmanagedResources(); } } diff --git a/src/Logic/VideoPlayers/libMpvDynamic.cs b/src/Logic/VideoPlayers/libMpvDynamic.cs index 6d02b292c..207297dac 100644 --- a/src/Logic/VideoPlayers/libMpvDynamic.cs +++ b/src/Logic/VideoPlayers/libMpvDynamic.cs @@ -550,7 +550,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers Dispose(); } - private void ReleaseUnmangedResources() + private void ReleaseUnmanagedResources() { try { @@ -603,7 +603,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers protected virtual void Dispose(bool disposing) { - ReleaseUnmangedResources(); + ReleaseUnmanagedResources(); } } }