summaryrefslogtreecommitdiff
path: root/lib/shared.go
diff options
context:
space:
mode:
authora1e7cb88 <[email protected]>2021-10-18 00:09:23 +0800
committera1e7cb88 <[email protected]>2021-10-18 00:09:23 +0800
commit113fd8f700015308e663c8904c95ddf374987b78 (patch)
tree0b81a126554c24b298b6e5e038f73beef2494ae9 /lib/shared.go
parentc0f88cb080950879bc8af5cf498ac3aa8a8c68fb (diff)
update mod
Diffstat (limited to 'lib/shared.go')
-rw-r--r--lib/shared.go54
1 files changed, 0 insertions, 54 deletions
diff --git a/lib/shared.go b/lib/shared.go
deleted file mode 100644
index b0cfb2f..0000000
--- a/lib/shared.go
+++ /dev/null
@@ -1,54 +0,0 @@
-package mkvlib
-
-import (
- "log"
- "os"
- "os/exec"
- "path/filepath"
- "runtime"
- "strings"
-)
-
-const libName = "mkvlib"
-const libVer = "v1.0.2"
-
-const LibFName = libName + " " + libVer
-
-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)
- _, _mkvmerge := exec.LookPath(mkvmerge)
- if _ttx != nil || _pyftsubset != nil {
- log.Printf(`Missing dependency: fonttools (need "%s" & "%s").`, ttx, pyftsubset)
- ec++
- }
- if _mkvextract != nil || _mkvmerge != nil {
- log.Printf(`Missing dependency: mkvtoolnix (need "%s" & "%s").`, mkvextract, mkvmerge)
- ec++
- }
- if ec > 0 {
- return nil
- }
- if _instance == nil {
- _instance = new(mkvProcessor)
- }
- return _instance
-}