mpv: Delays the fade in after enable returns
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
nemunaire 2024-10-01 19:32:55 +02:00
parent 1ae02a7d47
commit e38f103b82

View File

@ -124,13 +124,20 @@ func (s *MPVSource) Enable() (err error) {
}
var pfc interface{}
for err == nil && pfc.(bool) {
time.Sleep(250 * time.Millisecond)
pfc, err = conn.Get("core-idle")
}
err = nil
pfc, err = conn.Get("core-idle")
s.FadeIn(conn, 3, 50)
if err == nil && pfc.(bool) {
go func() {
for err == nil && pfc.(bool) {
time.Sleep(250 * time.Millisecond)
pfc, err = conn.Get("core-idle")
}
s.FadeIn(conn, 3, 50)
}()
} else {
s.FadeIn(conn, 3, 50)
}
}
return