From 6f8b04405a1ecfcaf65d942f2cddd96ae33bce5f Mon Sep 17 00:00:00 2001 From: Stu Leak Date: Fri, 9 Jan 2026 21:26:21 -0500 Subject: [PATCH] fix(player): clear canvas.Image File field to display GStreamer frames MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Critical fix for Fyne canvas rendering: Fyne's canvas.Image has two ways to display content: 1. File field (string path) - takes precedence 2. Image field (image.Image) - used if File is empty When buildVideoPane creates canvas.Image with NewImageFromFile(), it sets the File field. Later when frameDisplayLoop sets Image field, Fyne still tries to render from File path, ignoring the Image data. Fix: Clear img.File before setting img.Image in frameDisplayLoop. This allows GStreamer frames to actually display on screen instead of showing the static placeholder frame. Without this fix: - GStreamer extracts frames perfectly (confirmed by logs) - Frames are set to img.Image and Refresh() is called - But Fyne still renders the static file, not the dynamic frames With this fix: - img.File cleared, so Fyne uses img.Image field - Dynamic GStreamer frames display in real-time - Video playback now visible! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.go b/main.go index f2e05ee..d5fb556 100644 --- a/main.go +++ b/main.go @@ -11398,6 +11398,8 @@ func (p *playSession) frameDisplayLoop() { // Update UI on main thread fyne.CurrentApp().Driver().DoFromGoroutine(func() { if p.img != nil { + // Clear file reference so Fyne uses the Image field + p.img.File = "" p.img.Image = frame p.img.Refresh() logging.Debug(logging.CatPlayer, "Frame %d updated (%.2fs, paused=%v, size=%dx%d)",