summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorac79b0c6 <[email protected]>2022-05-26 12:46:46 +0800
committerac79b0c6 <[email protected]>2022-05-26 12:46:46 +0800
commit9d82f48777c1e130ee8cf90b35fd5af995c82626 (patch)
tree10bc7b541967f732fb598145e8072ee2b645b625
parentfe28d2cae30402f05432121a5318150fe1c960bf (diff)
update sdk
-rw-r--r--mkvlib/c/exports.go7
-rw-r--r--mkvlib/c/sdk.cs6
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<string> 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<bool[]>(json);
}
public static bool CreateMKV(string file, string[] tracks, string[] attachments, string output, string slang, string stitle, bool clean)