🎯 Major Improvements: • Unified FFmpeg Player: Rock-solid A/V sync with frame-accurate seeking • Import Standardization: Convert to absolute module imports across codebase • Build Fixes: Resolve critical syntax errors and compilation issues • Code Cleanup: Remove unused code and fix variable references 🔧 Technical Changes: • Fixed pipe initialization in unified player (internal/player/unified_ffmpeg_player.go) • Replaced platformConfig references with utils.GetFFmpegPath() calls • Added platform-specific exec utilities (exec_unix.go, exec_windows.go) • Enhanced UI components with improved color handling • Fixed missing closing brace in buildMetadataPanel function 🐛 Critical Fixes: • Resolved "unexpected name buildVideoPane, expected (" syntax error • Fixed undefined variable references (start → sampleStart) • Removed calls to non-existent ColoredSelect Enable/Disable methods • Corrected import paths from relative to absolute module references 📊 Impact: +470 insertions, -951 deletions • Eliminates blocking A/V synchronization issues • Enables advanced video enhancement feature development • Establishes consistent module architecture • Codebase now builds and runs successfully This commit establishes the foundation for Phase 2 enhancement features by providing rock-solid video playback capabilities.
35 lines
1.3 KiB
Go
35 lines
1.3 KiB
Go
package utils
|
|
|
|
import (
|
|
"context"
|
|
"os/exec"
|
|
"syscall"
|
|
)
|
|
|
|
// createCommandWindows is a platform-specific implementation for Windows.
|
|
// It ensures that the command is created without a new console window,
|
|
// preventing disruptive pop-ups when running console applications (like ffmpeg)
|
|
// from a GUI application.
|
|
func createCommandWindows(ctx context.Context, name string, arg ...string) *exec.Cmd {
|
|
cmd := exec.CommandContext(ctx, name, arg...)
|
|
// SysProcAttr is used to control process creation parameters on Windows.
|
|
// HideWindow: If true, the new process's console window will be hidden.
|
|
// CreationFlags: CREATE_NO_WINDOW (0x08000000) prevents the creation of a console window.
|
|
// This is crucial for a smooth GUI experience when launching CLI tools.
|
|
cmd.SysProcAttr = &syscall.SysProcAttr{
|
|
HideWindow: true,
|
|
CreationFlags: 0x08000000, // CREATE_NO_WINDOW
|
|
}
|
|
return cmd
|
|
}
|
|
|
|
// createCommandRawWindows is a platform-specific implementation for Windows, without a context.
|
|
// It applies the same console hiding behavior as CreateCommand.
|
|
func createCommandRawWindows(name string, arg ...string) *exec.Cmd {
|
|
cmd := exec.Command(name, arg...)
|
|
cmd.SysProcAttr = &syscall.SysProcAttr{
|
|
HideWindow: true,
|
|
CreationFlags: 0x08000000, // CREATE_NO_WINDOW
|
|
}
|
|
return cmd
|
|
} |