summaryrefslogtreecommitdiff
path: root/lib/shared.go
diff options
context:
space:
mode:
authorMkvAutoSubset <[email protected]>2021-10-17 20:17:58 +0800
committerKurenai <[email protected]>2021-10-17 20:17:58 +0800
commitc0f88cb080950879bc8af5cf498ac3aa8a8c68fb (patch)
treecaa193ee7f100a1b22d5fa7fa8dfe1120f7ae757 /lib/shared.go
parent70a7c4edba281122c05ef46e9efffe5309ef8448 (diff)
Bump to 3.1.3
- 增加C函数导出 - 增加python调用的demo
Diffstat (limited to 'lib/shared.go')
-rw-r--r--lib/shared.go20
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/shared.go b/lib/shared.go
index 215ce7a..b0cfb2f 100644
--- a/lib/shared.go
+++ b/lib/shared.go
@@ -2,11 +2,15 @@ package mkvlib
import (
"log"
+ "os"
"os/exec"
+ "path/filepath"
+ "runtime"
+ "strings"
)
const libName = "mkvlib"
-const libVer = "1.0.0"
+const libVer = "v1.0.2"
const LibFName = libName + " " + libVer
@@ -14,6 +18,20 @@ var _instance *mkvProcessor
func GetInstance() *mkvProcessor {
ec := 0
+ n := "PATH"
+ s := ":"
+ if runtime.GOOS == "windows" {
+ n = "path"
+ s = ";"
+ }
+ p := os.Getenv(n)
+ if !strings.HasSuffix(p, s) {
+ p += s
+ }
+ e, _ := os.Executable()
+ e, _ = filepath.Split(e)
+ p += e
+ _ = os.Setenv(n, p)
_, _ttx := exec.LookPath(ttx)
_, _pyftsubset := exec.LookPath(pyftsubset)
_, _mkvextract := exec.LookPath(mkvextract)