fix: also look for FFmpeg next to the running python interpreter

Dropping ffmpeg.exe into python_embeded (next to python.exe) is a common
Windows support instruction; scan sys.executable's folder after the
portable root and CWD candidates.
This commit is contained in:
Z User 2026-09-29 06:47:43 +00:00
parent d26e3297a6
commit 08229541c3

View File

@ -7,6 +7,7 @@ import math
import os import os
import shutil import shutil
import subprocess import subprocess
import sys
import tempfile import tempfile
import urllib.request import urllib.request
from .media import AUDIO_EXTENSIONS from .media import AUDIO_EXTENSIONS
@ -600,6 +601,7 @@ def get_ffmpeg_path(name: str = "ffmpeg") -> str | None:
if base: if base:
roots.append(base) roots.append(base)
roots.append(os.path.dirname(os.path.abspath(base))) roots.append(os.path.dirname(os.path.abspath(base)))
roots.append(os.path.dirname(os.path.abspath(sys.executable)))
roots.append(os.getcwd()) roots.append(os.getcwd())
for root in roots: for root in roots:
candidates.extend([ candidates.extend([