diff --git a/src/MpvNet/Player.cs b/src/MpvNet/Player.cs index 25310545..82568a40 100644 --- a/src/MpvNet/Player.cs +++ b/src/MpvNet/Player.cs @@ -73,6 +73,9 @@ public void Init(IntPtr formHandle, bool processCommandLine) MainHandle = mpv_create(); Handle = MainHandle; + if (MainHandle == IntPtr.Zero) + throw new Exception("error mpv_create"); + var events = Enum.GetValues().Cast(); foreach (mpv_event_id i in events) @@ -85,9 +88,6 @@ public void Init(IntPtr formHandle, bool processCommandLine) if (formHandle != IntPtr.Zero) TaskHelp.Run(MainEventLoop); - if (MainHandle == IntPtr.Zero) - throw new Exception("error mpv_create"); - if (App.IsTerminalAttached) { SetPropertyString("terminal", "yes");