./all run: use pulseaudio if present
authorRudolf Polzer <divverent@alientrap.org>
Mon, 10 May 2010 19:12:07 +0000 (21:12 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Mon, 10 May 2010 19:16:23 +0000 (21:16 +0200)
all

diff --git a/all b/all
index a5c458c974c6fc1acc8695f6dd251331eff16c86..8fb6e0d9b8cbbb086d6011b611b45c8ecf9e9de3 100755 (executable)
--- a/all
+++ b/all
@@ -503,6 +503,14 @@ case "$cmd" in
                        fi
                fi
                set -- "darkplaces/darkplaces$client" -nexuiz -customgamename Xonotic -customgamedirname1 data -customgamedirname2 "" -customgamescreenshotname xonotic -customgameuserdirname xonotic "$@"
+
+               # if pulseaudio is running: USE IT
+               if ps -C pulseaudio >/dev/null; then
+                       if ldd /usr/lib/libSDL.so 2>/dev/null | grep pulse >/dev/null; then
+                               export SDL_AUDIODRIVER=pulse
+                       fi
+               fi
+
                if [ -n "$USE_GDB" ]; then
                        set -- gdb --args "$@"
                fi