Skip to content

Commit 29192d1

Browse files
committed
Skip ytdl flag on macOS ARM
Fixes sounds failing to play in the packaged build on macOS. (cherry picked from commit d3d6bd8)
1 parent 7779fb0 commit 29192d1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

qt/aqt/mpv.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import inspect
3131
import json
3232
import os
33+
import platform
3334
import select
3435
import socket
3536
import subprocess
@@ -40,7 +41,7 @@
4041
from queue import Empty, Full, Queue
4142
from shutil import which
4243

43-
from anki.utils import is_win
44+
from anki.utils import is_mac, is_win
4445

4546

4647
class MPVError(Exception):
@@ -88,11 +89,13 @@ class MPVBase:
8889
"--keep-open=no",
8990
"--autoload-files=no",
9091
"--gapless-audio=no",
91-
"--no-ytdl",
9292
]
9393

9494
if is_win:
9595
default_argv += ["--af-add=lavfi=[apad=pad_dur=0.150]"]
96+
if not is_mac or platform.machine() != "arm64":
97+
# our arm64 mpv build doesn't support this option (compiled out)
98+
default_argv += ["--no-ytdl"]
9699

97100
def __init__(self, window_id=None, debug=False):
98101
self.window_id = window_id

0 commit comments

Comments
 (0)