check instantly if mpv is ready

This commit is contained in:
2025-06-28 13:10:43 +02:00
parent 195b00abf2
commit 0e44626c13

View File

@ -36,6 +36,13 @@ func IsReady(ctx context.Context, socket string) <-chan bool {
go func() {
defer close(out)
conn, err := net.Dial("unix", socket)
if err == nil {
defer conn.Close()
out <- true
return
}
ticker := time.NewTicker(100 * time.Millisecond)
defer ticker.Stop()