mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-05-27 09:32:35 -04:00
Finishing c# marshmalling.
This commit is contained in:
@@ -12,13 +12,13 @@ namespace Kyoo.InternalAPI.TranscoderLink
|
||||
public extern static int Init();
|
||||
|
||||
[DllImport(TranscoderPath, CallingConvention = CallingConvention.Cdecl)]
|
||||
private extern static int ExtractSubtitles(string path, string outPath, out IntPtr streams);
|
||||
private extern static IntPtr ExtractSubtitles(string path, string outPath, out int streams);
|
||||
|
||||
public static void ExtractSubtitles(string path, string outPath, out Stream[] streams)
|
||||
{
|
||||
int size = Marshal.SizeOf<Stream>();
|
||||
|
||||
int length = ExtractSubtitles(path, outPath, out IntPtr streamsPtr); //The streamsPtr is always nullptr
|
||||
IntPtr streamsPtr = ExtractSubtitles(path, outPath, out int length);
|
||||
if (length > 0)
|
||||
{
|
||||
streams = new Stream[length];
|
||||
|
||||
Reference in New Issue
Block a user