Commit eb3223ef authored by Martin Finkel's avatar Martin Finkel

Media: remove duplicated code

parent 3e771727
......@@ -241,14 +241,12 @@ namespace LibVLCSharp.Shared
public Media(LibVLC libVLC, Stream stream, params string[] options)
: base(() => CtorFromCallbacks(libVLC, stream), Native.LibVLCMediaRelease)
{
foreach(var option in options)
foreach (var option in options)
{
var optionUtf8 = option.ToUtf8();
MarshalUtils.PerformInteropAndFree(() => Native.LibVLCMediaAddOption(NativeReference, optionUtf8), optionUtf8);
AddOption(option);
}
}
static IntPtr CtorFromCallbacks(LibVLC libVLC, Stream stream)
{
if (libVLC == null) throw new ArgumentNullException(nameof(libVLC));
......
Markdown is supported
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