summaryrefslogtreecommitdiffstats
path: root/TOOLS/osxbundle/mpv.app/Contents
diff options
context:
space:
mode:
authorAkemi <der.richter@gmx.de>2017-02-01 21:42:58 +0100
committerAkemi <der.richter@gmx.de>2017-02-16 22:21:03 +0100
commita5b97104cff358beebdb7ed1e96f7ab441295afa (patch)
treedff27114200b91337906ed1043f5408e34647b25 /TOOLS/osxbundle/mpv.app/Contents
parentfdd1ef60288842a51a431bfaab05f53ef0b8f532 (diff)
downloadmpv-a5b97104cff358beebdb7ed1e96f7ab441295afa.tar.bz2
mpv-a5b97104cff358beebdb7ed1e96f7ab441295afa.tar.xz
osx: improve bundle handling
we have two problems here. first when mpv is started from the bundle it uses its own environment variables and possibly can't find for example the youtube-dl binary for our youtube-dl hook. second we couldn't reliable determine when mpv was started from the bundle, which led to the pseudo-gui usage even when the binary was invoked from a shell. to prevent this we will wrap the bundle binary with a shell script, which will only be called when we start mpv from the bundle. this way we can get the same environment variables, like $PATH, for our bundle and additional we can set the pseudo-gui only when started through this script. it is also possible to detect the bundle usage properly and accurately through the usage of another environment var. Fixes #2061
Diffstat (limited to 'TOOLS/osxbundle/mpv.app/Contents')
-rw-r--r--TOOLS/osxbundle/mpv.app/Contents/Info.plist2
-rwxr-xr-xTOOLS/osxbundle/mpv.app/Contents/MacOS/mpv-wrapper.sh3
-rw-r--r--TOOLS/osxbundle/mpv.app/Contents/Resources/mpv.conf1
3 files changed, 4 insertions, 2 deletions
diff --git a/TOOLS/osxbundle/mpv.app/Contents/Info.plist b/TOOLS/osxbundle/mpv.app/Contents/Info.plist
index c134abb173..11e34c4548 100644
--- a/TOOLS/osxbundle/mpv.app/Contents/Info.plist
+++ b/TOOLS/osxbundle/mpv.app/Contents/Info.plist
@@ -173,7 +173,7 @@
</dict>
</array>
<key>CFBundleExecutable</key>
- <string>mpv</string>
+ <string>mpv-wrapper.sh</string>
<key>CFBundleIconFile</key>
<string>icon</string>
<key>CFBundleIdentifier</key>
diff --git a/TOOLS/osxbundle/mpv.app/Contents/MacOS/mpv-wrapper.sh b/TOOLS/osxbundle/mpv.app/Contents/MacOS/mpv-wrapper.sh
new file mode 100755
index 0000000000..1a16975319
--- /dev/null
+++ b/TOOLS/osxbundle/mpv.app/Contents/MacOS/mpv-wrapper.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+export MPVBUNDLE="true"
+$SHELL -l -c "$(dirname "$0")/mpv --player-operation-mode=pseudo-gui"
diff --git a/TOOLS/osxbundle/mpv.app/Contents/Resources/mpv.conf b/TOOLS/osxbundle/mpv.app/Contents/Resources/mpv.conf
deleted file mode 100644
index bdffa7a951..0000000000
--- a/TOOLS/osxbundle/mpv.app/Contents/Resources/mpv.conf
+++ /dev/null
@@ -1 +0,0 @@
-player-operation-mode=pseudo-gui