fix: enable transcoding by default + register config defaults in loader
Transcoding was silently disabled because the TranscodingConfig struct had zero-value defaults (Enabled=false) and no defaults were registered in the config loader. Now defaults to enabled=true, hwaccel=auto, max_concurrent=3, quality=medium.
- commit
- b39db92c995fa21fc10621ee5945e2dec1631dcf
- author
- brice · · 2026-03-24 07:10 UTC
- committer
- brice · · 2026-03-28 04:39 UTC
- parent
- 84980e6
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +7 -1
M internal/infrastructure/config/loader.go +6 -0
| @@ -606,6 +606,12 @@ func (m *Manager) setEngineDefaults(defaults *Config) { | |||
| 606 | 606 | m.viper.SetDefault("engine.webkit.network_process_memory_poll_interval_sec", wk.NetworkProcessMemoryPollIntervalSec) | |
| 607 | 607 | m.viper.SetDefault("engine.webkit.network_process_memory_conservative_threshold", wk.NetworkProcessMemoryConservativeThreshold) | |
| 608 | 608 | m.viper.SetDefault("engine.webkit.network_process_memory_strict_threshold", wk.NetworkProcessMemoryStrictThreshold) | |
| 609 | + | ||
| 610 | + | // Transcoding defaults. | |
| 611 | + | m.viper.SetDefault("transcoding.enabled", true) | |
| 612 | + | m.viper.SetDefault("transcoding.hwaccel", "auto") | |
| 613 | + | m.viper.SetDefault("transcoding.max_concurrent", 3) | |
| 614 | + | m.viper.SetDefault("transcoding.quality", "medium") | |
| 609 | 615 | } | |
| 610 | 616 | ||
| 611 | 617 | // New returns a new default configuration instance. | |
| @@ -606,6 +606,12 @@ func (m *Manager) setEngineDefaults(defaults *Config) { | |||||
| 606 | m.viper.SetDefault("engine.webkit.network_process_memory_poll_interval_sec", wk.NetworkProcessMemoryPollIntervalSec) | 606 | m.viper.SetDefault("engine.webkit.network_process_memory_poll_interval_sec", wk.NetworkProcessMemoryPollIntervalSec) | ||
| 607 | m.viper.SetDefault("engine.webkit.network_process_memory_conservative_threshold", wk.NetworkProcessMemoryConservativeThreshold) | 607 | m.viper.SetDefault("engine.webkit.network_process_memory_conservative_threshold", wk.NetworkProcessMemoryConservativeThreshold) | ||
| 608 | m.viper.SetDefault("engine.webkit.network_process_memory_strict_threshold", wk.NetworkProcessMemoryStrictThreshold) | 608 | m.viper.SetDefault("engine.webkit.network_process_memory_strict_threshold", wk.NetworkProcessMemoryStrictThreshold) | ||
| 609 | + | ||||
| 610 | + | // Transcoding defaults. | |||
| 611 | + | m.viper.SetDefault("transcoding.enabled", true) | |||
| 612 | + | m.viper.SetDefault("transcoding.hwaccel", "auto") | |||
| 613 | + | m.viper.SetDefault("transcoding.max_concurrent", 3) | |||
| 614 | + | m.viper.SetDefault("transcoding.quality", "medium") | |||
| 609 | } | 615 | } | ||
| 610 | 616 | ||||
| 611 | // New returns a new default configuration instance. | 617 | // New returns a new default configuration instance. | ||
M internal/infrastructure/config/schema.go +1 -1
| @@ -369,7 +369,7 @@ type DownloadsConfig struct { | |||
| 369 | 369 | // When enabled, proprietary video formats (H.264, HEVC) are transcoded | |
| 370 | 370 | // to open codecs (VP9, AV1) that CEF can decode natively. | |
| 371 | 371 | type TranscodingConfig struct { | |
| 372 | - | // Enabled controls whether transcoding is active (default: false). | |
| 372 | + | // Enabled controls whether transcoding is active (default: true). | |
| 373 | 373 | Enabled bool `mapstructure:"enabled" yaml:"enabled" toml:"enabled"` | |
| 374 | 374 | // HWAccel selects the hardware acceleration API: "auto", "vaapi", or "nvenc". | |
| 375 | 375 | // Default: "auto" (tries VAAPI first, then CUDA). | |
| @@ -369,7 +369,7 @@ type DownloadsConfig struct { | |||||
| 369 | // When enabled, proprietary video formats (H.264, HEVC) are transcoded | 369 | // When enabled, proprietary video formats (H.264, HEVC) are transcoded | ||
| 370 | // to open codecs (VP9, AV1) that CEF can decode natively. | 370 | // to open codecs (VP9, AV1) that CEF can decode natively. | ||
| 371 | type TranscodingConfig struct { | 371 | type TranscodingConfig struct { | ||
| 372 | - | // Enabled controls whether transcoding is active (default: false). | 372 | + | // Enabled controls whether transcoding is active (default: true). |
| 373 | Enabled bool `mapstructure:"enabled" yaml:"enabled" toml:"enabled"` | 373 | Enabled bool `mapstructure:"enabled" yaml:"enabled" toml:"enabled"` | ||
| 374 | // HWAccel selects the hardware acceleration API: "auto", "vaapi", or "nvenc". | 374 | // HWAccel selects the hardware acceleration API: "auto", "vaapi", or "nvenc". | ||
| 375 | // Default: "auto" (tries VAAPI first, then CUDA). | 375 | // Default: "auto" (tries VAAPI first, then CUDA). | ||