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:
parent
ac030e9f2f
commit
10b605464c
|
|
@ -415,8 +415,7 @@ func writeSpumuxXML(path, overlayPath, highlightPath, selectPath string, buttons
|
||||||
var b strings.Builder
|
var b strings.Builder
|
||||||
b.WriteString("<subpictures>\n")
|
b.WriteString("<subpictures>\n")
|
||||||
b.WriteString(" <stream>\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(overlayPath),
|
||||||
escapeXMLAttr(highlightPath),
|
escapeXMLAttr(highlightPath),
|
||||||
escapeXMLAttr(selectPath),
|
escapeXMLAttr(selectPath),
|
||||||
|
|
@ -475,9 +474,9 @@ func findVTLogoPath() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func escapeDrawtextText(text string) 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, "'", "\\'")
|
||||||
escaped = strings.ReplaceAll(escaped, "%", "\\%")
|
escaped = strings.ReplaceAll(escaped, "%", "\\%")
|
||||||
return escaped
|
return escaped
|
||||||
}
|
}
|
||||||
6
main.go
6
main.go
|
|
@ -10996,12 +10996,6 @@ func newPlaySession(path string, w, h int, fps, duration float64, targetW, targe
|
||||||
unifiedAdapter: unifiedAdapter,
|
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
|
// Create UnifiedPlayer adapter instead of dual-process player
|
||||||
adapter := player.NewUnifiedPlayerAdapter(path, w, h, fps, duration, targetW, targetH, prog, frameFunc, img)
|
adapter := player.NewUnifiedPlayerAdapter(path, w, h, fps, duration, targetW, targetH, prog, frameFunc, img)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user