summaryrefslogtreecommitdiff
path: root/mkvlib
diff options
context:
space:
mode:
authorb5f0d6c3 <[email protected]>2022-04-26 18:35:43 +0800
committerb5f0d6c3 <[email protected]>2022-04-26 18:35:43 +0800
commit90672d8e982811ec7ca3eac2b7a96a2eb6d816f5 (patch)
tree7ae738ff79c5b877a1271ff71a5ca4765560bea3 /mkvlib
parent2dd0bdd567230fc5b3a41ec17554d8e7ca2ed1e3 (diff)
update mkvlib:add mks output support.
Diffstat (limited to 'mkvlib')
-rw-r--r--mkvlib/c/exports.go8
-rw-r--r--mkvlib/c/sdk.cs10
-rw-r--r--mkvlib/c/sdk.py9
-rw-r--r--mkvlib/mkv.go12
-rw-r--r--mkvlib/shared.go2
5 files changed, 36 insertions, 5 deletions
diff --git a/mkvlib/c/exports.go b/mkvlib/c/exports.go
index 2729ff5..80f1c16 100644
--- a/mkvlib/c/exports.go
+++ b/mkvlib/c/exports.go
@@ -167,6 +167,14 @@ func Cache(p *C.char) {
getter.GetProcessorInstance().Cache(gs(p))
}
+//export MKS
+func MKS() {
+ if !checkInstance() {
+ return
+ }
+ getter.GetProcessorInstance().MKS()
+}
+
func cs(gs string) *C.char {
return C.CString(gs)
}
diff --git a/mkvlib/c/sdk.cs b/mkvlib/c/sdk.cs
index 4699b1d..a565e55 100644
--- a/mkvlib/c/sdk.cs
+++ b/mkvlib/c/sdk.cs
@@ -38,7 +38,7 @@ public static class mkvlib
static extern bool MakeMKVs(IntPtr dir, IntPtr data, IntPtr output, IntPtr slang, IntPtr stitle, logCallback lcb);
[DllImport("mkvlib.so")]
- static extern bool A2P(bool a2p, bool apc, int pr, int pf);
+ static extern void A2P(bool a2p, bool apc, int pr, int pf);
[DllImport("mkvlib.so")]
static extern IntPtr GetFontsList(IntPtr dir, logCallback lcb);
@@ -47,6 +47,9 @@ public static class mkvlib
static extern void Cache(IntPtr p);
[DllImport("mkvlib.so")]
+ static extern void MKS();
+
+ [DllImport("mkvlib.so")]
static extern IntPtr CreateFontsCache(IntPtr dir, IntPtr output, logCallback lcb);
[DllImport("mkvlib.so")]
@@ -129,6 +132,11 @@ public static class mkvlib
Cache(cs(p));
}
+ public static void MKS()
+ {
+ MKS();
+ }
+
public static string[] CreateFontsCache(string dir, string output, Action<string> lcb)
{
string result = css(CreateFontsCache(cs(dir), cs(output), _lcb(lcb)));
diff --git a/mkvlib/c/sdk.py b/mkvlib/c/sdk.py
index 5a67caf..f2c693b 100644
--- a/mkvlib/c/sdk.py
+++ b/mkvlib/c/sdk.py
@@ -70,7 +70,7 @@ def makeMKVs(dir, data, output, slang, stitle, lcb):
def a2p(en, apc, pr, pf):
call = lib.A2P
- return call(en, apc, pr, pf)
+ call(en, apc, pr, pf)
def getFontsList(dir, lcb):
@@ -81,7 +81,7 @@ def getFontsList(dir, lcb):
def cache(p):
call = lib.Cache
- return call(p.encode())
+ call(p.encode())
def createFontsCache(dir, output, lcb):
@@ -93,3 +93,8 @@ def createFontsCache(dir, output, lcb):
def copyFontsFromCache(subs, dist, lcb):
call = lib.CopyFontsFromCache
return call(subs.encode(), dist.encode(), lcb)
+
+
+def mks():
+ call = lib.MKS
+ call()
diff --git a/mkvlib/mkv.go b/mkvlib/mkv.go
index 2ce06ec..2c1ca03 100644
--- a/mkvlib/mkv.go
+++ b/mkvlib/mkv.go
@@ -38,6 +38,7 @@ type mkvInfo struct {
type mkvProcessor struct {
a2p bool
apc bool
+ mks bool
pr int
pf int
cache string
@@ -151,7 +152,12 @@ func (self *mkvProcessor) CreateMKV(file string, tracks, attachments []string, o
if clean {
args = append(args, "--no-subtitles", "--no-attachments")
}
- args = append(args, file)
+ if !self.mks {
+ args = append(args, file)
+ } else {
+ d, _, _, ne := splitPath(output)
+ output = path.Join(d, ne+".mks")
+ }
for _, _item := range attachments {
args = append(args, "--attach-file", _item)
}
@@ -365,3 +371,7 @@ func (self *mkvProcessor) CopyFontsFromCache(subs, dist string, lcb logCallback)
func (self *mkvProcessor) Cache(p string) {
self.cache = p
}
+
+func (self *mkvProcessor) MKS() {
+ self.mks = true
+}
diff --git a/mkvlib/shared.go b/mkvlib/shared.go
index 4f0cbdd..94b6abd 100644
--- a/mkvlib/shared.go
+++ b/mkvlib/shared.go
@@ -11,7 +11,7 @@ import (
)
const libName = "mkvlib"
-const libVer = "v1.4.5"
+const libVer = "v1.4.6"
const LibFName = libName + " " + libVer