You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
util.Debugf("Timeout after %.2fs waiting for mpv socket", elapsed.Seconds())
518
+
ifstderr.Len() >0 {
519
+
util.Debugf("mpv stderr during timeout: %s", stderr.String())
520
+
}
498
521
499
-
// Cleanup if timeout occurs
500
-
ifkillErr:=cmd.Process.Kill(); killErr!=nil {
501
-
util.Debugf("Failed to kill mpv process: %v", killErr)
522
+
// Best-effort cleanup. On Windows Kill returns "Access is denied" if the
523
+
// process already exited between the last probe and here — ignore that.
524
+
ifcmd.Process!=nil {
525
+
ifkillErr:=cmd.Process.Kill(); killErr!=nil {
526
+
util.Debugf("Failed to kill mpv process (often already exited): %v", killErr)
527
+
}
502
528
}
529
+
// Drain Wait so we don't leak the reaper goroutine's result unnoticed.
530
+
select {
531
+
casewaitErr:=<-waitErrCh:
532
+
ifwaitErr!=nil {
533
+
util.Debugf("mpv wait after timeout: %v", waitErr)
534
+
}
535
+
case<-time.After(500*time.Millisecond):
536
+
}
537
+
538
+
stderrHint:=strings.TrimSpace(stderr.String())
539
+
ifstderrHint!="" {
540
+
return"", fmt.Errorf("timeout waiting for mpv socket after %.1fs.\nmpv stderr: %s\nmpv path: %s\nPossible issues:\n1. MPV crashed or GPU/video output failed (common on VMs — try updating GPU drivers or reinstall mpv)\n2. MPV installation corrupted / missing DLLs\n3. Invalid video URL\nCheck debug logs with -debug flag", elapsed.Seconds(), stderrHint, mpvPath)
541
+
}
542
+
return"", fmt.Errorf("timeout waiting for mpv socket after %.1fs.\nmpv path: %s\nPossible issues:\n1. MPV hung before creating IPC (GPU/driver issue on VMs)\n2. MPV installation corrupted / missing DLLs\n3. Invalid video URL\nRun: \"%s\" --version\nCheck debug logs with -debug flag", elapsed.Seconds(), mpvPath, mpvPath)
543
+
}
503
544
504
-
return"", fmt.Errorf("timeout waiting for mpv socket after %.1fs. Possible issues:\n1. Slow network connection - video source may be unresponsive\n2. MPV installation corrupted\n3. Firewall blocking IPC\n4. Invalid video URL\nCheck debug logs with -debug flag", elapsed.Seconds())
545
+
// formatMPVEarlyExitError builds a clear error when mpv dies before the IPC
546
+
// socket appears. This is the common failure mode on minimal Windows VMs.
util.Debugf("mpv exited before IPC socket was ready: %v stderr=%q path=%s", waitErr, stderrOut, mpvPath)
550
+
ifstderrOut!="" {
551
+
returnfmt.Errorf("mpv exited before IPC socket was ready: %v\nmpv stderr: %s\nmpv path: %s\nHint: on Windows VMs OpenGL often fails — GoAnime uses a VO fallback chain; if this persists, reinstall mpv or run mpv manually", waitErr, stderrOut, mpvPath)
552
+
}
553
+
returnfmt.Errorf("mpv exited before IPC socket was ready: %v\nmpv path: %s (no stderr captured)\nHint: bundled mpv may be missing DLLs, or video output failed. Run: \"%s\" --version", waitErr, mpvPath, mpvPath)
505
554
}
506
555
507
556
// MpvSendCommand is a wrapper function to expose mpvSendCommand to other packages
0 commit comments