From a345b5a4573cf157d6f92d9f363c35993e28a17f Mon Sep 17 00:00:00 2001 From: Stu Leak Date: Sun, 30 Nov 2025 00:34:32 -0500 Subject: [PATCH] Fix DVD target option ordering for direct and queued converts --- main.go | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 3e3bed8..1ad5c35 100644 --- a/main.go +++ b/main.go @@ -819,15 +819,16 @@ func (s *appState) executeConvertJob(ctx context.Context, job *queue.Job, progre // Check if this is a DVD format (special handling required) selectedFormat, _ := cfg["selectedFormat"].(formatOption) isDVD := selectedFormat.Ext == ".mpg" + var targetOption string // DVD presets: enforce compliant target, frame rate, resolution, codecs if isDVD { if strings.Contains(selectedFormat.Label, "PAL") { - args = append(args, "-target", "pal-dvd") + targetOption = "pal-dvd" cfg["frameRate"] = "25" cfg["targetResolution"] = "PAL (720×576)" } else { - args = append(args, "-target", "ntsc-dvd") + targetOption = "ntsc-dvd" cfg["frameRate"] = "29.97" cfg["targetResolution"] = "NTSC (720×480)" } @@ -1042,6 +1043,10 @@ func (s *appState) executeConvertJob(ctx context.Context, job *queue.Job, progre args = append(args, "-movflags", "+faststart") } + if targetOption != "" { + args = append(args, "-target", targetOption) + } + // Progress feed args = append(args, "-progress", "pipe:1", "-nostats") args = append(args, outputPath) @@ -3431,6 +3436,7 @@ func (s *appState) startConvert(status *widget.Label, btn, cancelBtn *widget.But src := s.source cfg := s.convert isDVD := cfg.SelectedFormat.Ext == ".mpg" + var targetOption string outDir := filepath.Dir(src.Path) outName := cfg.OutputFile() if outName == "" { @@ -3450,11 +3456,11 @@ func (s *appState) startConvert(status *widget.Label, btn, cancelBtn *widget.But // DVD presets: enforce compliant codecs, frame rate, resolution, and target if isDVD { if strings.Contains(cfg.SelectedFormat.Label, "PAL") { - args = append(args, "-target", "pal-dvd") + targetOption = "pal-dvd" cfg.FrameRate = "25" cfg.TargetResolution = "PAL (720×576)" } else { - args = append(args, "-target", "ntsc-dvd") + targetOption = "ntsc-dvd" cfg.FrameRate = "29.97" cfg.TargetResolution = "NTSC (720×480)" } @@ -3610,6 +3616,11 @@ func (s *appState) startConvert(status *widget.Label, btn, cancelBtn *widget.But args = append(args, "-movflags", "+faststart") } + // Apply target for DVD (must come before output path) + if targetOption != "" { + args = append(args, "-target", targetOption) + } + // Progress feed to stdout for live updates. args = append(args, "-progress", "pipe:1", "-nostats") args = append(args, outPath)