From 9d82f48777c1e130ee8cf90b35fd5af995c82626 Mon Sep 17 00:00:00 2001 From: ac79b0c6 <105047743+ac79b0c6@users.noreply.github.com> Date: Thu, 26 May 2022 12:46:46 +0800 Subject: update sdk --- mkvlib/c/exports.go | 7 +------ mkvlib/c/sdk.cs | 6 +----- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/mkvlib/c/exports.go b/mkvlib/c/exports.go index 32c21af..b75d121 100644 --- a/mkvlib/c/exports.go +++ b/mkvlib/c/exports.go @@ -42,18 +42,13 @@ func DumpMKV(file, output *C.char, subset bool, lcb C.logCallback) bool { return getter.GetProcessorInstance().DumpMKV(gs(file), gs(output), subset, _lcb(lcb)) } -type checkSubset_R struct { - Subsetted bool `json:"subsetted"` - Error bool `json:"error"` -} - //export CheckSubset func CheckSubset(file *C.char, lcb C.logCallback) *C.char { if !checkInstance() { return cs("") } a, b := getter.GetProcessorInstance().CheckSubset(gs(file), _lcb(lcb)) - data, _ := json.Marshal(checkSubset_R{a, b}) + data, _ := json.Marshal([]bool{a, b}) return cs(string(data)) } diff --git a/mkvlib/c/sdk.cs b/mkvlib/c/sdk.cs index d174357..9913a1a 100644 --- a/mkvlib/c/sdk.cs +++ b/mkvlib/c/sdk.cs @@ -103,11 +103,7 @@ public static class mkvlib public static bool[] CheckSubset(string file, Action lcb) { string json = css(CheckSubset(cs(file), _lcb(lcb))); - JsonDocument doc = JsonDocument.Parse(json); - bool[] result = new bool[2]; - result[0] = doc.RootElement.GetProperty("subsetted").GetBoolean(); - result[1] = doc.RootElement.GetProperty("error").GetBoolean(); - return result; + return JsonSerializer.Deserialize(json); } public static bool CreateMKV(string file, string[] tracks, string[] attachments, string output, string slang, string stitle, bool clean) -- cgit v1.2.1