summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-11-18 11:44:55 +0100
committerjaseg <git@jaseg.de>2023-11-18 11:45:07 +0100
commit93cf60e109b592fcca07f98864d05e5503c59d05 (patch)
tree0db17d7eae1dfde34c319391238f37beab95ba77
parent0bfd64d1f1923ca1039ca34f3ff9f8830bc47102 (diff)
downloadpython-mpv-93cf60e109b592fcca07f98864d05e5503c59d05.tar.gz
python-mpv-93cf60e109b592fcca07f98864d05e5503c59d05.tar.bz2
python-mpv-93cf60e109b592fcca07f98864d05e5503c59d05.zip
Add libmpv-2.dll to windows library search list
-rw-r--r--mpv.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/mpv.py b/mpv.py
index 27fed4f..ac024b7 100644
--- a/mpv.py
+++ b/mpv.py
@@ -35,12 +35,9 @@ import traceback
if os.name == 'nt':
# Note: mpv-2.dll with API version 2 corresponds to mpv v0.35.0. Most things should work with the fallback, too.
- dll = ctypes.util.find_library('mpv-2.dll') or ctypes.util.find_library('mpv-1.dll')
+ dll = ctypes.util.find_library('mpv-2.dll') or ctypes.util.find_library('libmpv-2.dll') or ctypes.util.find_library('mpv-1.dll')
if dll is None:
- raise OSError('Cannot find mpv-1.dll or mpv-2.dll in your system %PATH%. One way to deal with this is to ship '
- 'the dll with your script and put the directory your script is in into %PATH% before '
- '"import mpv": os.environ["PATH"] = os.path.dirname(__file__) + os.pathsep + os.environ["PATH"] '
- 'If mpv-1.dll is located elsewhere, you can add that path to os.environ["PATH"].')
+ raise OSError('Cannot find mpv-1.dll, mpv-2.dll or libmpv-2.dll in your system %PATH%. One way to deal with this is to ship the dll with your script and put the directory your script is in into %PATH% before "import mpv": os.environ["PATH"] = os.path.dirname(__file__) + os.pathsep + os.environ["PATH"] If mpv-1.dll is located elsewhere, you can add that path to os.environ["PATH"].')
backend = CDLL(dll)
fs_enc = 'utf-8'
else:
@@ -52,10 +49,7 @@ else:
sofile = ctypes.util.find_library('mpv')
if sofile is None:
- raise OSError("Cannot find libmpv in the usual places. Depending on your distro, you may try installing an "
- "mpv-devel or mpv-libs package. If you have libmpv around but this script can't find it, consult "
- "the documentation for ctypes.util.find_library which this script uses to look up the library "
- "filename.")
+ raise OSError("Cannot find libmpv in the usual places. Depending on your distro, you may try installing an mpv-devel or mpv-libs package. If you have libmpv around but this script can't find it, consult the documentation for ctypes.util.find_library which this script uses to look up the library filename.")
backend = CDLL(sofile)
fs_enc = sys.getfilesystemencoding()