mpv.net
mpv.net copied to clipboard
fix: check MainHandle for null before starting MainEventLoop thread
Init started the MainEventLoop background thread before checking whether mpv_create() returned a non-null handle. If mpv_create fails the thread is already running and calls mpv_wait_event(IntPtr.Zero, -1), which is undefined behavior.
Moved the null-check to immediately after mpv_create(), before any thread is started or any mpv API is called.