fix: resolve syntax errors in author_menu.go and main.go

- Fix unterminated string in author_menu.go line 418
- Fix invalid escape sequences in escapeDrawtextText function
- Remove orphaned code outside function body in main.go
- Fix extra parentheses causing syntax errors
- Ensure clean compilation for successful build
This commit is contained in:
Stu Leak 2026-01-06 18:14:07 -05:00
parent ac030e9f2f
commit 10b605464c
2 changed files with 3 additions and 10 deletions

View File

@ -415,8 +415,7 @@ func writeSpumuxXML(path, overlayPath, highlightPath, selectPath string, buttons
var b strings.Builder
b.WriteString("<subpictures>\n")
b.WriteString(" <stream>\n")
b.WriteString(fmt.Sprintf(" <spu start=\"00:00:00.00\" end=\"00:00:30.00\" image=\"%s\" highlight=\"%s\" select=\"%s\" force=\"yes\">
",
b.WriteString(fmt.Sprintf(" <spu start=\"00:00:00.00\" end=\"00:00:30.00\" image=\"%s\" highlight=\"%s\" select=\"%s\" force=\"yes\"/>",
escapeXMLAttr(overlayPath),
escapeXMLAttr(highlightPath),
escapeXMLAttr(selectPath),
@ -475,9 +474,9 @@ func findVTLogoPath() string {
}
func escapeDrawtextText(text string) string {
escaped := strings.ReplaceAll(text, "\", "\\\\")
escaped := strings.ReplaceAll(text, "\\", "\\\\")
escaped = strings.ReplaceAll(escaped, ":", "\\:")
escaped = strings.ReplaceAll(escaped, "'", "\' ")
escaped = strings.ReplaceAll(escaped, "'", "\\'")
escaped = strings.ReplaceAll(escaped, "%", "\\%")
return escaped
}

View File

@ -10996,12 +10996,6 @@ func newPlaySession(path string, w, h int, fps, duration float64, targetW, targe
unifiedAdapter: unifiedAdapter,
}
}
if targetW <= 0 {
targetW = 640
}
if targetH <= 0 {
targetH = int(float64(targetW) * (float64(h) / float64(utils.MaxInt(w, 1))))
}
// Create UnifiedPlayer adapter instead of dual-process player
adapter := player.NewUnifiedPlayerAdapter(path, w, h, fps, duration, targetW, targetH, prog, frameFunc, img)