sbcl 2.1.11 rebuild
[arch-packages.git] / ossp / trunk / 0002-Hack-to-work-with-modern-PulseAudio.patch
blobe0cc444eae1d375702e9bfec2d461451b6bca744
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
3 Date: Fri, 18 Dec 2020 23:17:36 +0000
4 Subject: [PATCH] Hack to work with modern PulseAudio
6 ---
7 ossp-padsp.c | 8 ++++++++
8 1 file changed, 8 insertions(+)
10 diff --git a/ossp-padsp.c b/ossp-padsp.c
11 index c505b57..b4ac097 100644
12 --- a/ossp-padsp.c
13 +++ b/ossp-padsp.c
14 @@ -22,6 +22,8 @@
15 #include <sys/stat.h>
16 #include <sys/types.h>
17 #include <unistd.h>
18 +#include <linux/limits.h>
19 +#include <stdlib.h>
21 #include <pulse/pulseaudio.h>
22 #include <sys/soundcard.h>
23 @@ -1478,9 +1480,15 @@ static void action_post(void)
24 int main(int argc, char **argv)
26 int rc;
27 + static char runtime_dir[PATH_MAX];
29 ossp_slave_init("ossp-padsp", argc, argv);
31 + snprintf(runtime_dir, sizeof runtime_dir, "/run/user/%llu",
32 + (long long unsigned) getuid());
33 + if (access(runtime_dir, R_OK | X_OK) == 0)
34 + setenv("XDG_RUNTIME_DIR", runtime_dir, 0);
36 page_size = sysconf(_SC_PAGE_SIZE);
38 mainloop = pa_threaded_mainloop_new();