Skip to content

Instantly share code, notes, and snippets.

@myrup
myrup / LICENSE
Last active October 2, 2023 08:52 — forked from mattjohnsonpint/LICENSE
Unified global Unhandled Exception event for .NET MAUI
MIT License
Copyright (c) 2022 Matt Johnson-Pint
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
public static class LibMpv {
const string mpv = "mpv-1.dll";
[DllImport(mpv, EntryPoint = "mpv_command_string", CallingConvention = CallingConvention.Cdecl)]
public static extern MpvError Command(IntPtr ctx, [In()] [MarshalAs(UnmanagedType.LPStr)] string args);
[DllImport(mpv, EntryPoint = "mpv_initialize", CallingConvention = CallingConvention.Cdecl)]
public static extern MpvError Initialize(IntPtr ctx);
static void Main(string[] args)
{
var file = "http://m.radiofollow.me:8000/live192";
var handles = new List<IntPtr>();
var rand = new Random();
for (int i = 0; i < 10; i++)
{
var handle = LibMpv.Create();
handles.Add(handle);
LibMpv.Initialize(handle);