disable unused mpv events

This commit is contained in:
stax76
2022-07-11 06:57:10 +02:00
parent ec17ae8ce9
commit 6157a01701
2 changed files with 15 additions and 0 deletions

View File

@@ -118,6 +118,18 @@ namespace mpvnet
Handle = mpv_create();
mpv_event_id[] events = {
mpv_event_id.MPV_EVENT_START_FILE,
mpv_event_id.MPV_EVENT_AUDIO_RECONFIG,
mpv_event_id.MPV_EVENT_FILE_LOADED,
mpv_event_id.MPV_EVENT_VIDEO_RECONFIG,
mpv_event_id.MPV_EVENT_PLAYBACK_RESTART,
mpv_event_id.MPV_EVENT_END_FILE
};
foreach (mpv_event_id i in events)
mpv_request_event(Handle, i, 0);
mpv_request_log_messages(Handle, "no");
App.RunTask(() => MainEventLoop());

View File

@@ -65,6 +65,9 @@ public class libmpv
[DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr mpv_wait_event(IntPtr mpvHandle, double timeout);
[DllImport("mpv-2.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern mpv_error mpv_request_event(IntPtr mpvHandle, mpv_event_id id, int enable);
public enum mpv_error
{
MPV_ERROR_SUCCESS = 0,