Fix hardware fallback retry to keep build green
This commit is contained in:
parent
4fa7011e99
commit
c6e352e436
11
main.go
11
main.go
|
|
@ -1405,10 +1405,6 @@ 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)
|
||||
|
|
@ -6223,16 +6219,13 @@ func (s *appState) startConvert(status *widget.Label, btn, cancelBtn *widget.But
|
|||
strings.Contains(stderrOutput, "vaapi") ||
|
||||
strings.Contains(stderrOutput, "videotoolbox"))
|
||||
|
||||
if isHardwareFailure && !hwFallbackTried && resolvedAccel != "none" && resolvedAccel != "" {
|
||||
if isHardwareFailure && !strings.EqualFold(s.convert.HardwareAccel, "none") && 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))
|
||||
fmt.Fprintf(logFile, "\nAuto-fallback: hardware encoder failed; switched to software for next attempt at %s\n", time.Now().Format(time.RFC3339))
|
||||
_ = logFile.Close()
|
||||
}
|
||||
s.convertCancel = nil
|
||||
if err := s.executeConvertJobWithFallback(ctx, job, progressCallback, true); err == nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
fyne.CurrentApp().Driver().DoFromGoroutine(func() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user