- Current state: 3 modules partially/fully extracted
- upscale_module.go: showUpscaleView + AI helpers migrated successfully
- Build syntax: ✅ Clean
- Build failing due to unrelated Fyne API issue in internal/ui/queueview.go
- Ready for next incremental extraction steps
- Move showUpscaleView() from main.go to upscale_module.go
- Remove AI helper functions (detectAIUpscaleBackend, checkAIFaceEnhanceAvailable, etc.)
- Syntax passes, ready for further migration
- Build error is unrelated Fyne API issue in internal/ui
- main.go restored from corruption (13,664 lines)
- upscale_module.go created with AI helper functions
- Ready for safer incremental extraction approach
- Create thumb_module.go with showThumbView(), buildThumbView(), executeThumbJob()
- Remove showThumbView() from main.go
- buildThumbView() and executeThumbJob() still in main.go to be removed
- Syntax check passes
- Working on large function extraction
Priority 2: FFmpeg Volume Control
- Moved volume processing from Go to FFmpeg -af volume filter
- Eliminated CPU-intensive per-sample processing loop
- Removed ~40 lines of hot-path audio processing code
- Reduced CPU usage during playback significantly
- Dynamic volume changes restart audio seamlessly
Changes:
- Build FFmpeg command with volume filter
- Remove per-sample int16 processing loop
- Remove encoding/binary import (no longer needed)
- Add restartAudio() for dynamic volume changes
- Volume changes >5% trigger audio restart with new filter
Priority 5: Adaptive Frame Timing
- Implemented drift correction for smooth video playback
- Frame dropping when >3 frames behind schedule
- Gradual catchup when moderately behind
- Maintains smooth playback under system load
Frame Timing Logic:
- Behind < 0: Sleep until next frame (ahead of schedule)
- Behind > 3 frames: Drop frame and resync (way behind)
- Behind > 0.5 frames: Catch up gradually (moderately behind)
- Otherwise: Maintain normal pace
Performance Improvements:
- Audio: No more per-chunk volume processing overhead
- Video: Adaptive timing handles temporary slowdowns
- CPU: Significant reduction in audio processing load
- Smoothness: Better handling of system hiccups
Testing Notes:
- Audio stuttering should be greatly reduced
- Volume changes have ~200ms glitch during restart
- Frame drops logged every 30 frames to avoid spam
- Works with all frame rates (24/30/60 fps)
Still TODO (Priority 3):
- Single FFmpeg process for perfect A/V sync
- Currently separate video/audio processes can drift
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Refactoring:
- Create inspect_module.go (292 lines)
- Move showInspectView() and buildInspectView()
- Reduce main.go from 14,329 to 14,116 lines (-213 lines)
- Reduce main.go from 426KB to 420KB
This is the first step in modularizing main.go to improve:
- Windows build performance (currently 5+ minutes)
- Code maintainability and organization
- Following established pattern from author_module.go and subtitles_module.go
Remaining modules to extract:
- player, compare, thumb, filters, upscale, merge, convert, queue, benchmark
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Convert Module:
- Add "Add All to Queue" button when multiple videos loaded
- Batch-add all loaded videos to queue with one click
- Remove confirmation dialogs for faster workflow
- Queue button updates immediately to show new count
- Button only visible when 2+ videos are loaded
Workflow improvements:
- No more clicking through videos one by one to queue
- No "OK" confirmation clicks required
- Queue count updates instantly in View Queue button
- Auto-starts queue after adding jobs
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Player Module Drag and Drop:
- Add handleDrop case for player module
- Drag video files onto player to load them
- Works the same way as convert module
- Auto-probe and load first video file from drop
Author Module:
- Enable Author module button in main menu
- Add "author" to enabled modules list (line 1525)
- Module is now clickable and functional
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>