summaryrefslogtreecommitdiff
path: root/vendor/codeberg.org
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2024-08-07 13:38:02 +0000
committerLibravatar GitHub <noreply@github.com>2024-08-07 15:38:02 +0200
commit3045782b490ad5f409bd479583de5d9c179e4195 (patch)
tree754e0a5781620def851fe8964e0eaee7b94ea569 /vendor/codeberg.org
parent[bugfix] send back Sec-Websocket-Protocol header for streaming WebSocket (#3169) (diff)
downloadgotosocial-3045782b490ad5f409bd479583de5d9c179e4195.tar.xz
updates our ffmpreg version, heh (#3181)
Diffstat (limited to 'vendor/codeberg.org')
-rw-r--r--vendor/codeberg.org/gruf/go-ffmpreg/embed/ffmpeg/ffmpeg.wasmbin12736397 -> 12737395 bytes
-rw-r--r--vendor/codeberg.org/gruf/go-ffmpreg/embed/ffprobe/ffprobe.wasmbin12648386 -> 12649401 bytes
-rw-r--r--vendor/codeberg.org/gruf/go-ffmpreg/wasm/instance.go64
3 files changed, 6 insertions, 58 deletions
diff --git a/vendor/codeberg.org/gruf/go-ffmpreg/embed/ffmpeg/ffmpeg.wasm b/vendor/codeberg.org/gruf/go-ffmpreg/embed/ffmpeg/ffmpeg.wasm
index a6f89abb7..5ab309072 100644
--- a/vendor/codeberg.org/gruf/go-ffmpreg/embed/ffmpeg/ffmpeg.wasm
+++ b/vendor/codeberg.org/gruf/go-ffmpreg/embed/ffmpeg/ffmpeg.wasm
Binary files differ
diff --git a/vendor/codeberg.org/gruf/go-ffmpreg/embed/ffprobe/ffprobe.wasm b/vendor/codeberg.org/gruf/go-ffmpreg/embed/ffprobe/ffprobe.wasm
index 7522d9472..d6f758b82 100644
--- a/vendor/codeberg.org/gruf/go-ffmpreg/embed/ffprobe/ffprobe.wasm
+++ b/vendor/codeberg.org/gruf/go-ffmpreg/embed/ffprobe/ffprobe.wasm
Binary files differ
diff --git a/vendor/codeberg.org/gruf/go-ffmpreg/wasm/instance.go b/vendor/codeberg.org/gruf/go-ffmpreg/wasm/instance.go
index 21a080ce9..7900ecd08 100644
--- a/vendor/codeberg.org/gruf/go-ffmpreg/wasm/instance.go
+++ b/vendor/codeberg.org/gruf/go-ffmpreg/wasm/instance.go
@@ -4,7 +4,6 @@ import (
"context"
"errors"
"io"
- "sync"
"github.com/tetratelabs/wazero"
"github.com/tetratelabs/wazero/sys"
@@ -66,53 +65,6 @@ func (inst *Instantiator) New(ctx context.Context) (*Instance, error) {
}, nil
}
-type InstancePool struct {
- Instantiator
-
- pool []*Instance
- lock sync.Mutex
-}
-
-func (p *InstancePool) Get(ctx context.Context) (*Instance, error) {
- for {
- // Check for cached.
- inst := p.Cached()
- if inst == nil {
- break
- }
-
- // Check if closed.
- if inst.IsClosed() {
- continue
- }
-
- return inst, nil
- }
-
- // Must create new instance.
- return p.Instantiator.New(ctx)
-}
-
-func (p *InstancePool) Put(inst *Instance) {
- if inst.inst != &p.Instantiator {
- panic("instance and pool instantiators do not match")
- }
- p.lock.Lock()
- p.pool = append(p.pool, inst)
- p.lock.Unlock()
-}
-
-func (p *InstancePool) Cached() *Instance {
- var inst *Instance
- p.lock.Lock()
- if len(p.pool) > 0 {
- inst = p.pool[len(p.pool)-1]
- p.pool = p.pool[:len(p.pool)-1]
- }
- p.lock.Unlock()
- return inst
-}
-
// Instance ...
//
// NOTE: Instance is NOT concurrency
@@ -153,18 +105,14 @@ func (inst *Instance) Run(ctx context.Context, args Args) (uint32, error) {
// Instantiate the module from precompiled wasm module data.
mod, err := inst.wzrt.InstantiateModule(ctx, inst.cmod, modcfg)
-
- if mod != nil {
- // Close module.
- mod.Close(ctx)
- }
-
- // Check for a returned exit code error.
- if err, ok := err.(*sys.ExitError); ok {
+ switch err := err.(type) {
+ case nil:
+ return 0, mod.Close(ctx)
+ case *sys.ExitError:
return err.ExitCode(), nil
+ default:
+ return 0, err
}
-
- return 0, err
}
func (inst *Instance) IsClosed() bool {