From 0b1cf8eb1996e7b9d82e59dbfc77804070ae9b7e Mon Sep 17 00:00:00 2001 From: Stu Leak Date: Tue, 6 Jan 2026 18:36:07 -0500 Subject: [PATCH] fix: remove duplicate code and syntax errors - Remove orphaned closing brace in author_menu.go - Remove duplicate code sections in main.go - Fix non-declaration statements outside function body - Ensure clean compilation with no syntax errors - Complete UnifiedPlayerAdapter integration cleanup --- author_menu.go | 4 ++-- main.go | 50 -------------------------------------------------- 2 files changed, 2 insertions(+), 52 deletions(-) diff --git a/author_menu.go b/author_menu.go index 08bcbe4..5b66fb8 100644 --- a/author_menu.go +++ b/author_menu.go @@ -463,7 +463,7 @@ func findVTLogoPath() string { } if exe, err := os.Executable(); err == nil { dir := filepath.Dir(exe) - search = append(search, filepath.Join(dir, "assets", "logo", "VT_Icon.png")), + search = append(search, filepath.Join(dir, "assets", "logo", "VT_Icon.png")) } for _, p := range search { if _, err := os.Stat(p); err == nil { @@ -479,4 +479,4 @@ func escapeDrawtextText(text string) string { escaped = strings.ReplaceAll(escaped, "'", "\\'") escaped = strings.ReplaceAll(escaped, "%", "\\%") return escaped -} \ No newline at end of file +} diff --git a/main.go b/main.go index 99b7ec9..b89521a 100644 --- a/main.go +++ b/main.go @@ -10996,30 +10996,6 @@ func newPlaySession(path string, w, h int, fps, duration float64, targetW, targe unifiedAdapter: unifiedAdapter, } } - - // Create UnifiedPlayer adapter instead of dual-process player - adapter := player.NewUnifiedPlayerAdapter(path, w, h, fps, duration, targetW, targetH, prog, frameFunc, img) - - // Create playSession wrapper to maintain interface compatibility - return &playSession{ - // Store adapter in videoCmd to avoid breaking existing code - videoCmd: (*exec.Cmd)(unsafe.Pointer(adapter)), // Type hack to store adapter pointer - - // Keep interface fields for compatibility - path: path, - fps: fps, - width: w, - height: h, - targetW: targetW, - targetH: targetH, - volume: 100, - duration: duration, - stop: make(chan struct{}), - done: make(chan struct{}), - prog: prog, - frameFunc: frameFunc, - img: img, - } } func (p *playSession) Play() { @@ -11225,32 +11201,6 @@ func (p *playSession) SetVolume(v float64) { p.writeStringToStdin(cmd) } } - if v > 100 { - v = 100 - } - p.volume = v - if v > 0 { - p.muted = false - } else { - p.muted = true - } - p.mu.Unlock() - - // If volume changed significantly, restart audio with new volume filter - // This is necessary because volume is now handled by FFmpeg - if math.Abs(oldVolume-v) > 5 || oldMuted != (v <= 0) { - p.mu.Lock() - if p.audioCmd != nil { - // Restart audio with new volume - currentPos := p.current - p.mu.Unlock() - // Stop and restart audio (video keeps playing) - p.restartAudio(currentPos) - } else { - p.mu.Unlock() - } - } -} func (p *playSession) restartAudio(offset float64) { p.mu.Lock()