Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Ender Taşdemir
LibVLCSharp
Commits
3d662c9c
Commit
3d662c9c
authored
Nov 03, 2021
by
Martin Finkel
Browse files
media: clarify error message if native media constructor fails
parent
8cca1d47
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/LibVLCSharp/Shared/Internal.cs
View file @
3d662c9c
...
...
@@ -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"
);
}
}
src/LibVLCSharp/Shared/Media.cs
View file @
3d662c9c
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment