Skip to content
This repository was archived by the owner on May 2, 2026. It is now read-only.

Commit 0524af6

Browse files
committed
fix(ipc): add checks for Unix domain socket availability in MPVIPCClient and MpvIPCPlayer
1 parent a2fc9e4 commit 0524af6

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • viu_media/cli/service/player/ipc

viu_media/cli/service/player/ipc/mpv.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ def __init__(self, socket_path: str):
5757

5858
def connect(self, timeout: float = 5.0) -> None:
5959
"""Connect to MPV IPC socket and start the reader thread."""
60+
if not hasattr(socket, "AF_UNIX"):
61+
raise MPVIPCError("Unix domain sockets are unavailable on this platform")
62+
6063
start_time = time.time()
6164
while time.time() - start_time < timeout:
6265
try:
@@ -299,6 +302,10 @@ def play(
299302
def _play_with_ipc(self, player: BasePlayer, params: PlayerParams) -> PlayerResult:
300303
"""Play media using MPV IPC."""
301304
try:
305+
if not hasattr(socket, "AF_UNIX"):
306+
raise MPVIPCError(
307+
"MPV IPC requires Unix domain sockets, which are unavailable on this platform."
308+
)
302309
self._start_mpv_process(player, params)
303310
self._connect_ipc()
304311
self._setup_event_handling()

0 commit comments

Comments
 (0)