fix(ffmpeg): use app-writable temporary directory for stream buffers

This commit is contained in:
Levi committed 2026-09-13 18:00:10 +08:00
1 parent 9124976b5c
commit 637004c8a8
6 files changed
+61 -8

No files matched your search

+3
View File
@@ -160,6 +160,8 @@ func (e *Engine) addCleanup(cleanup func()) {
}
type Config struct {
// TempDir supplies an app-writable directory for FFmpeg stream buffers.
TempDir string
// HTTPUserAgent is a snapshot of the downloader HTTP default. Nil leaves standalone engines unchanged.
HTTPUserAgent *string
ProxyConfig *base.DownloaderProxyConfig
@@ -207,6 +209,7 @@ func NewEngine(cfg *Config) *Engine {
return
}
if err := ffmpegapi.Enable(runtime, loop, &ffmpegapi.Config{
TempDir: cfg.TempDir,
ProxyHandler: cfg.ProxyConfig.ToHandler(),
DefaultUserAgent: cfg.HTTPUserAgent,
RegisterCleanup: engine.addCleanup,