mirror of
https://github.com/neutrinolabs/pulseaudio-module-xrdp.git
synced 2025-06-03 06:30:16 +00:00
Merge pull request #15 from metalefty/remove-xrdp-dependency
Remove xrdp dependency
This commit is contained in:
commit
ce110ead22
@ -4,7 +4,7 @@ SRC_DIR=${PWD}
|
||||
|
||||
cd /tmp
|
||||
yum install -y epel-release
|
||||
yum install -y xrdp xrdp-devel xrdp-selinux wget sudo
|
||||
yum install -y wget sudo
|
||||
yum install -y pulseaudio pulseaudio-libs pulseaudio-libs-devel
|
||||
yum install -y rpmdevtools yum-utils
|
||||
yum-builddep -y pulseaudio
|
||||
|
@ -6,7 +6,7 @@ cd /tmp
|
||||
sed -i.bak -e 's|^# deb-src|deb-src|' /etc/apt/sources.list
|
||||
|
||||
apt update
|
||||
apt install -y build-essential dpkg-dev libpulse-dev pulseaudio pkg-config xrdp
|
||||
apt install -y build-essential dpkg-dev libpulse-dev pulseaudio pkg-config
|
||||
apt install -y g++ clang
|
||||
|
||||
apt install -y pulseaudio
|
||||
|
@ -45,8 +45,6 @@ AC_PROG_LN_S
|
||||
AC_PROG_MAKE_SET
|
||||
|
||||
# Checks for libraries.
|
||||
PKG_CHECK_MODULES([XRDP], [xrdp >= 0.9.0])
|
||||
AC_SUBST(XRDP_CFLAGS)
|
||||
PKG_CHECK_MODULES([LIBPULSE], [libpulse])
|
||||
|
||||
m4_define([PULSE_MSG], [PULSE_DIR not specified. Follow the instructions in README.md.])
|
||||
|
@ -59,9 +59,6 @@
|
||||
#include <pulsecore/thread-mq.h>
|
||||
#include <pulsecore/rtpoll.h>
|
||||
|
||||
#include <xrdp_sockets.h>
|
||||
|
||||
|
||||
/* defined in pulse/version.h */
|
||||
#if PA_PROTOCOL_VERSION > 28
|
||||
/* these used to be defined in pulsecore/macro.h */
|
||||
@ -297,6 +294,7 @@ static int lsend(int fd, char *data, int bytes) {
|
||||
static int data_send(struct userdata *u, pa_memchunk *chunk) {
|
||||
char *data;
|
||||
char *socket_dir;
|
||||
char *sink_socket;
|
||||
int bytes;
|
||||
int sent;
|
||||
int fd;
|
||||
@ -318,9 +316,21 @@ static int data_send(struct userdata *u, pa_memchunk *chunk) {
|
||||
{
|
||||
socket_dir = "/tmp/.xrdp";
|
||||
}
|
||||
snprintf(s.sun_path, bytes, "%s/" CHANSRV_PORT_OUT_BASE_STR,
|
||||
socket_dir, u->display_num);
|
||||
sink_socket = getenv("XRDP_PULSE_SINK_SOCKET");
|
||||
if (sink_socket == NULL || sink_socket[0] == '\0')
|
||||
{
|
||||
pa_log_debug("Could not obtain sink_socket from environment.");
|
||||
/* usually it doesn't reach here. if the socket name is not given
|
||||
via environment variable, use hardcoded name as fallback */
|
||||
snprintf(sink_socket, bytes, "xrdp_chansrv_audio_out_socket_%d", u->display_num);
|
||||
}
|
||||
else
|
||||
{
|
||||
pa_log_debug("Obtained sink_socket from environment.");
|
||||
}
|
||||
snprintf(s.sun_path, bytes, "%s/%s", socket_dir, sink_socket);
|
||||
pa_log_debug("trying to connect to %s", s.sun_path);
|
||||
|
||||
if (connect(fd, (struct sockaddr *)&s,
|
||||
sizeof(struct sockaddr_un)) != 0) {
|
||||
u->failed_connect_time = pa_rtclock_now();
|
||||
|
@ -46,9 +46,6 @@
|
||||
#include <pulsecore/thread-mq.h>
|
||||
#include <pulsecore/thread.h>
|
||||
|
||||
#include <xrdp_sockets.h>
|
||||
|
||||
|
||||
/* defined in pulse/version.h */
|
||||
#if PA_PROTOCOL_VERSION > 28
|
||||
/* these used to be defined in pulsecore/macro.h */
|
||||
@ -181,6 +178,7 @@ static int data_get(struct userdata *u, pa_memchunk *chunk) {
|
||||
struct sockaddr_un s;
|
||||
char *data;
|
||||
char *socket_dir;
|
||||
char *source_socket;
|
||||
char buf[11];
|
||||
unsigned char ubuf[10];
|
||||
|
||||
@ -195,8 +193,20 @@ static int data_get(struct userdata *u, pa_memchunk *chunk) {
|
||||
{
|
||||
socket_dir = "/tmp/.xrdp";
|
||||
}
|
||||
snprintf(s.sun_path, bytes, "%s/" CHANSRV_PORT_IN_BASE_STR,
|
||||
socket_dir, u->display_num);
|
||||
source_socket = getenv("XRDP_PULSE_SINK_SOCKET");
|
||||
if (source_socket == NULL || source_socket[0] == '\0')
|
||||
{
|
||||
|
||||
pa_log("Could not obtain source_socket from environment.");
|
||||
/* usually it doesn't reach here. if the socket name is not given
|
||||
via environment variable, use hardcoded name as fallback */
|
||||
snprintf(source_socket, bytes, "xrdp_chansrv_audio_in_socket_%d", u->display_num);
|
||||
}
|
||||
else
|
||||
{
|
||||
pa_log("Obtained sink_socket from environment.");
|
||||
}
|
||||
snprintf(s.sun_path, bytes, "%s/%s", socket_dir, source_socket);
|
||||
pa_log_debug("Trying to connect to %s", s.sun_path);
|
||||
|
||||
if (connect(fd, (struct sockaddr *) &s, sizeof(struct sockaddr_un)) != 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user