Commit 3d662c9c authored by Martin Finkel's avatar Martin Finkel
Browse files

media: clarify error message if native media constructor fails

parent 8cca1d47
......@@ -33,9 +33,8 @@ namespace LibVLCSharp.Shared
{
Release = release;
var nativeRef = create();
if(nativeRef == IntPtr.Zero)
throw new VLCException("Failed to perform instanciation on the native side. " +
"Make sure you installed the correct VideoLAN.LibVLC.[YourPlatform] package in your platform specific project");
if (nativeRef == IntPtr.Zero)
OnNativeInstanciationError();
NativeReference = nativeRef;
}
......@@ -61,5 +60,8 @@ namespace LibVLCSharp.Shared
NativeReference = IntPtr.Zero;
IsDisposed = true;
}
internal virtual void OnNativeInstanciationError() => throw new VLCException("Failed to perform instanciation on the native side. " +
"Make sure you installed the correct VideoLAN.LibVLC.[YourPlatform] package in your platform specific project");
}
}
......@@ -635,6 +635,13 @@ namespace LibVLCSharp.Shared
Native.LibVLCMediaRetain(NativeReference);
}
internal override void OnNativeInstanciationError()
{
throw new VLCException("Failed to instanciate the Media on the native side. " +
$"{Environment.NewLine}Have you installed the latest LibVLC package from nuget for your target platform?" +
$"{Environment.NewLine}Is your MRL correct? Do check the native LibVLC verbose logs for more information.");
}
#region MediaFromStream
static readonly InternalOpenMedia OpenMediaCallbackHandle = OpenMediaCallback;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment