Commit 7f5feda7 authored by Jérémy VIGNELLES's avatar Jérémy VIGNELLES Committed by Martin Finkel

Declared non-seekable streams as non-seekable in callback input

These are the same changes as https://github.com/ZeBobo5/Vlc.DotNet/pull/648

Also increased the buffer size to match the libvlc buffer size.

# Conflicts:
#	src/LibVLCSharp/Media.cs
parent feebe646
......@@ -41,7 +41,7 @@ namespace LibVLCSharp
[DllImport(Constants.LibraryName, CallingConvention = CallingConvention.Cdecl,
EntryPoint = "libvlc_media_new_callbacks")]
internal static extern IntPtr LibVLCMediaNewCallbacks(IntPtr libVLC, InternalOpenMedia openCb, InternalReadMedia readCb,
InternalSeekMedia seekCb, InternalCloseMedia closeCb, IntPtr opaque);
InternalSeekMedia? seekCb, InternalCloseMedia closeCb, IntPtr opaque);
[DllImport(Constants.LibraryName, CallingConvention = CallingConvention.Cdecl,
EntryPoint = "libvlc_media_add_option")]
......@@ -295,7 +295,7 @@ namespace LibVLCSharp
return Native.LibVLCMediaNewCallbacks(libVLC.NativeReference,
OpenMediaCallbackHandle,
ReadMediaCallbackHandle,
SeekMediaCallbackHandle,
input.CanSeek ? SeekMediaCallbackHandle : null,
CloseMediaCallbackHandle,
GCHandle.ToIntPtr(input.GcHandle));
}
......
......@@ -23,6 +23,11 @@ namespace LibVLCSharp
GcHandle = GCHandle.Alloc(this);
}
/// <summary>
/// A value indicating whether this Media input can be seeked in.
/// </summary>
public bool CanSeek { get; protected set; } = true;
/// <summary>
/// LibVLC calls this method when it wants to open the media
/// </summary>
......
......@@ -21,6 +21,7 @@ namespace LibVLCSharp
public StreamMediaInput(Stream stream)
{
_stream = stream ?? throw new ArgumentNullException(nameof(stream));
CanSeek = stream.CanSeek;
}
/// <summary>
......
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