Compare commits

..

No commits in common. "b1b5412cdb33843b6deac63d80e667dcdf922ac3" and "04e6f893232b7f823b2bb5a53c3850ee66b1dbb3" have entirely different histories.

2 changed files with 20 additions and 11 deletions

View File

@ -1,6 +1,9 @@
package app
import "git.leaktechnologies.dev/stu/VideoTools/internal/convert"
import (
"fmt"
"git.leaktechnologies.dev/stu/VideoTools/internal/convert"
)
// DVDConvertConfig wraps the convert.convertConfig for DVD-specific operations
// This adapter allows main.go to work with the convert package without refactoring

26
main.go
View File

@ -1405,13 +1405,10 @@ func (s *appState) jobExecutor(ctx context.Context, job *queue.Job, progressCall
// executeConvertJob executes a conversion job from the queue
func (s *appState) executeConvertJob(ctx context.Context, job *queue.Job, progressCallback func(float64)) error {
return s.executeConvertJobWithFallback(ctx, job, progressCallback, false)
}
func (s *appState) executeConvertJobWithFallback(ctx context.Context, job *queue.Job, progressCallback func(float64), hwFallbackTried bool) error {
cfg := job.Config
inputPath := cfg["inputPath"].(string)
outputPath := cfg["outputPath"].(string)
hwFallbackTried, _ := cfg["hwFallbackTried"].(bool)
// If a direct conversion is running, wait until it finishes before starting queued jobs.
for s.convertBusy {
@ -6224,13 +6221,22 @@ func (s *appState) startConvert(status *widget.Label, btn, cancelBtn *widget.But
strings.Contains(stderrOutput, "videotoolbox"))
if isHardwareFailure && !hwFallbackTried && resolvedAccel != "none" && resolvedAccel != "" {
s.convert.HardwareAccel = "none"
if logFile != nil {
fmt.Fprintf(logFile, "\nAuto-fallback: retrying with software encoder at %s\n", time.Now().Format(time.RFC3339))
_ = logFile.Close()
accelVal, _ := cfg["hardwareAccel"].(string)
if accelVal == "" {
accelVal = "auto"
}
if !strings.EqualFold(accelVal, "none") {
cfg["hardwareAccel"] = "none"
cfg["hwFallbackTried"] = true
job.Config = cfg
s.convert.HardwareAccel = "none"
if logFile != nil {
fmt.Fprintf(logFile, "\nAuto-fallback: retrying with software encoder at %s\n", time.Now().Format(time.RFC3339))
_ = logFile.Close()
}
s.convertCancel = nil
return s.executeConvertJob(ctx, job, progressCallback)
}
s.convertCancel = nil
return s.executeConvertJobWithFallback(ctx, job, progressCallback, true)
}
fyne.CurrentApp().Driver().DoFromGoroutine(func() {