Skip to content

Commit d19d0a1

Browse files
heftigdavidebeatrici
authored andcommitted
Hack to work with modern PulseAudio
1 parent 14a9cff commit d19d0a1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ossp-padsp.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#include <sys/stat.h>
2323
#include <sys/types.h>
2424
#include <unistd.h>
25+
#include <linux/limits.h>
26+
#include <stdlib.h>
2527

2628
#include <pulse/pulseaudio.h>
2729
#include <sys/soundcard.h>
@@ -1534,9 +1536,15 @@ static void action_post(void)
15341536
int main(int argc, char **argv)
15351537
{
15361538
int rc;
1539+
static char runtime_dir[PATH_MAX];
15371540

15381541
ossp_slave_init(argc, argv);
15391542

1543+
snprintf(runtime_dir, sizeof runtime_dir, "/run/user/%llu",
1544+
(long long unsigned) getuid());
1545+
if (access(runtime_dir, R_OK | X_OK) == 0)
1546+
setenv("XDG_RUNTIME_DIR", runtime_dir, 0);
1547+
15401548
page_size = sysconf(_SC_PAGE_SIZE);
15411549

15421550
mainloop = pa_threaded_mainloop_new();

0 commit comments

Comments
 (0)