[bugfix] ensure testrig package only compiled-in when debug enabled (#3185)

* ensure testrig package only compiled-in (including init) when debug enabled

* add code comment to testrig init to indicate WebAssembly compilation
This commit is contained in:
kim 2024-08-09 10:53:29 +00:00 committed by GitHub
commit 4a3ece0c6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 54 additions and 19 deletions

View file

@ -19,6 +19,7 @@ package testrig
import (
"context"
"fmt"
"os"
"strconv"
"time"
@ -34,11 +35,13 @@ func init() {
ctx := context.Background()
// Ensure global ffmpeg WASM pool initialized.
fmt.Println("testrig: precompiling ffmpeg WASM")
if err := ffmpeg.InitFfmpeg(ctx, 1); err != nil {
panic(err)
}
// Ensure global ffmpeg WASM pool initialized.
fmt.Println("testrig: precompiling ffprobe WASM")
if err := ffmpeg.InitFfprobe(ctx, 1); err != nil {
panic(err)
}