Fix DVD target option ordering for direct and queued converts
This commit is contained in:
parent
453d6280ed
commit
b86be96fcc
19
main.go
19
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)
|
// Check if this is a DVD format (special handling required)
|
||||||
selectedFormat, _ := cfg["selectedFormat"].(formatOption)
|
selectedFormat, _ := cfg["selectedFormat"].(formatOption)
|
||||||
isDVD := selectedFormat.Ext == ".mpg"
|
isDVD := selectedFormat.Ext == ".mpg"
|
||||||
|
var targetOption string
|
||||||
|
|
||||||
// DVD presets: enforce compliant target, frame rate, resolution, codecs
|
// DVD presets: enforce compliant target, frame rate, resolution, codecs
|
||||||
if isDVD {
|
if isDVD {
|
||||||
if strings.Contains(selectedFormat.Label, "PAL") {
|
if strings.Contains(selectedFormat.Label, "PAL") {
|
||||||
args = append(args, "-target", "pal-dvd")
|
targetOption = "pal-dvd"
|
||||||
cfg["frameRate"] = "25"
|
cfg["frameRate"] = "25"
|
||||||
cfg["targetResolution"] = "PAL (720×576)"
|
cfg["targetResolution"] = "PAL (720×576)"
|
||||||
} else {
|
} else {
|
||||||
args = append(args, "-target", "ntsc-dvd")
|
targetOption = "ntsc-dvd"
|
||||||
cfg["frameRate"] = "29.97"
|
cfg["frameRate"] = "29.97"
|
||||||
cfg["targetResolution"] = "NTSC (720×480)"
|
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")
|
args = append(args, "-movflags", "+faststart")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if targetOption != "" {
|
||||||
|
args = append(args, "-target", targetOption)
|
||||||
|
}
|
||||||
|
|
||||||
// Progress feed
|
// Progress feed
|
||||||
args = append(args, "-progress", "pipe:1", "-nostats")
|
args = append(args, "-progress", "pipe:1", "-nostats")
|
||||||
args = append(args, outputPath)
|
args = append(args, outputPath)
|
||||||
|
|
@ -3431,6 +3436,7 @@ func (s *appState) startConvert(status *widget.Label, btn, cancelBtn *widget.But
|
||||||
src := s.source
|
src := s.source
|
||||||
cfg := s.convert
|
cfg := s.convert
|
||||||
isDVD := cfg.SelectedFormat.Ext == ".mpg"
|
isDVD := cfg.SelectedFormat.Ext == ".mpg"
|
||||||
|
var targetOption string
|
||||||
outDir := filepath.Dir(src.Path)
|
outDir := filepath.Dir(src.Path)
|
||||||
outName := cfg.OutputFile()
|
outName := cfg.OutputFile()
|
||||||
if outName == "" {
|
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
|
// DVD presets: enforce compliant codecs, frame rate, resolution, and target
|
||||||
if isDVD {
|
if isDVD {
|
||||||
if strings.Contains(cfg.SelectedFormat.Label, "PAL") {
|
if strings.Contains(cfg.SelectedFormat.Label, "PAL") {
|
||||||
args = append(args, "-target", "pal-dvd")
|
targetOption = "pal-dvd"
|
||||||
cfg.FrameRate = "25"
|
cfg.FrameRate = "25"
|
||||||
cfg.TargetResolution = "PAL (720×576)"
|
cfg.TargetResolution = "PAL (720×576)"
|
||||||
} else {
|
} else {
|
||||||
args = append(args, "-target", "ntsc-dvd")
|
targetOption = "ntsc-dvd"
|
||||||
cfg.FrameRate = "29.97"
|
cfg.FrameRate = "29.97"
|
||||||
cfg.TargetResolution = "NTSC (720×480)"
|
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")
|
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.
|
// Progress feed to stdout for live updates.
|
||||||
args = append(args, "-progress", "pipe:1", "-nostats")
|
args = append(args, "-progress", "pipe:1", "-nostats")
|
||||||
args = append(args, outPath)
|
args = append(args, outPath)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user