fix: final cleanup of syntax errors in main.go
- Remove extra closing brace on line 10999 - Remove large block of duplicate orphaned code (lines 11127-11170) - Ensure all code is within proper function bodies - Complete UnifiedPlayerAdapter integration with clean syntax - Ready for successful compilation
This commit is contained in:
parent
0b1cf8eb19
commit
a0b4d53978
45
main.go
45
main.go
|
|
@ -10996,7 +10996,6 @@ func newPlaySession(path string, w, h int, fps, duration float64, targetW, targe
|
||||||
unifiedAdapter: unifiedAdapter,
|
unifiedAdapter: unifiedAdapter,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
func (p *playSession) Play() {
|
func (p *playSession) Play() {
|
||||||
p.mu.Lock()
|
p.mu.Lock()
|
||||||
|
|
@ -11126,50 +11125,6 @@ func (p *playSession) StepFrame(delta int) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate current frame from time position (not from p.frameN which resets on seek)
|
|
||||||
currentFrame := int(p.current * p.fps)
|
|
||||||
targetFrame := currentFrame + delta
|
|
||||||
|
|
||||||
// Clamp to valid range
|
|
||||||
if targetFrame < 0 {
|
|
||||||
targetFrame = 0
|
|
||||||
}
|
|
||||||
maxFrame := int(p.duration * p.fps)
|
|
||||||
if targetFrame > maxFrame {
|
|
||||||
targetFrame = maxFrame
|
|
||||||
}
|
|
||||||
|
|
||||||
// Convert to time offset
|
|
||||||
offset := float64(targetFrame) / p.fps
|
|
||||||
if offset < 0 {
|
|
||||||
offset = 0
|
|
||||||
}
|
|
||||||
if offset > p.duration {
|
|
||||||
offset = p.duration
|
|
||||||
}
|
|
||||||
|
|
||||||
// Auto-pause when frame stepping
|
|
||||||
p.paused = true
|
|
||||||
p.current = offset
|
|
||||||
p.stopLocked()
|
|
||||||
p.startLocked(p.current)
|
|
||||||
p.paused = true
|
|
||||||
|
|
||||||
// Ensure pause is maintained
|
|
||||||
time.AfterFunc(30*time.Millisecond, func() {
|
|
||||||
p.mu.Lock()
|
|
||||||
defer p.mu.Unlock()
|
|
||||||
p.paused = true
|
|
||||||
})
|
|
||||||
|
|
||||||
if p.prog != nil {
|
|
||||||
p.prog(p.current)
|
|
||||||
}
|
|
||||||
if p.frameFunc != nil {
|
|
||||||
p.frameFunc(targetFrame)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetCurrentFrame returns the current frame number
|
// GetCurrentFrame returns the current frame number
|
||||||
func (p *playSession) GetCurrentFrame() int {
|
func (p *playSession) GetCurrentFrame() int {
|
||||||
p.mu.Lock()
|
p.mu.Lock()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user