File 0004-kodi-workaround-pipewire-bug.patch of Package kodi (Revision f167715df23d4fd861379745cd984899)

Currently displaying revision f167715df23d4fd861379745cd984899 , Show latest

42
 
1
diff -rup a/tools/Linux/kodi.sh.in b/tools/Linux/kodi.sh.in
2
--- a/tools/Linux/kodi.sh.in    2024-04-06 04:29:22.000000000 +0200
3
+++ b/tools/Linux/kodi.sh.in    2024-04-22 17:58:07.556342563 +0200
4
@@ -171,6 +171,7 @@ if command_exists gdb; then
5
   fi
6
 fi
7
 
8
+ENV_ARGS=
9
 if [ -n "${KODI_AE_SINK}" ]; then
10
 
11
   echo "KODI_AE_SINK env variable is deprecated and will be removed in the future."
12
@@ -189,6 +190,14 @@ if [ -n "${KODI_AE_SINK}" ]; then
13
   elif [ "${KODI_AE_SINK}" = "ALSA+PULSE" ]; then
14
     ENV_ARGS="--audio-backend=alsa+pulseaudio"
15
   fi
16
+else
17
+  # Work around a possibly broken installation of pipewire on openSUSE Leap
18
+  # see 'https://bugzilla.opensuse.org/show_bug.cgi?id=1222636'
19
+  if [ -x ${prefix}/bin/pulseaudio ] &&
20
+     [ -x ${prefix}/bin/pipewire ] &&
21
+     [ ! -x ${prefix}/bin/pipewire-pulse ]; then
22
+    ENV_ARGS="--audio-backend=pulseaudio"
23
+  fi
24
 fi
25
 
26
 if [ -n "${KODI_GL_INTERFACE}" ]; then
27
@@ -197,11 +206,11 @@ if [ -n "${KODI_GL_INTERFACE}" ]; then
28
   echo "Use the --gl-interface command line switch instead."
29
 
30
   if [ "${KODI_GL_INTERFACE}" = "GLX" ]; then
31
-    ENV_ARGS="--gl-interface=glx"
32
+    ENV_ARGS="${ENV_ARGS} --gl-interface=glx"
33
   elif [ "${KODI_GL_INTERFACE}" = "EGL" ]; then
34
-    ENV_ARGS="--gl-interface=egl"
35
+    ENV_ARGS="${ENV_ARGS} --gl-interface=egl"
36
   elif [ "${KODI_GL_INTERFACE}" = "EGL_PB" ]; then
37
-    ENV_ARGS="--gl-interface=egl-pb"
38
+    ENV_ARGS="${ENV_ARGS} --gl-interface=egl-pb"
39
   fi
40
 fi
41
 
42