update to master

This commit is contained in:
Chengyi Zhao 2024-06-25 17:03:12 +08:00
parent 7138fa0272
commit fccb4bd29d
107 changed files with 29 additions and 51635 deletions

View file

@ -467,17 +467,10 @@ int pa_card_suspend(pa_card *c, bool suspend, pa_suspend_cause_t cause) {
}
static int card_message_handler(const char *object_path, const char *message, const pa_json_object *parameters, char **response, void *userdata) {
<<<<<<< HEAD
pa_card *c;
char *message_handler_path;
pa_assert(c = (pa_card *) userdata);
=======
pa_card *c = userdata;
char *message_handler_path;
pa_assert(c);
>>>>>>> c1990dd02647405b0c13aab59f75d05cbb202336
pa_assert(message);
pa_assert(response);

View file

@ -40,10 +40,7 @@
#include <pulsecore/log.h>
#include <pulsecore/macro.h>
#include <pulsecore/strbuf.h>
<<<<<<< HEAD
=======
#include <pulsecore/namereg.h>
>>>>>>> c1990dd02647405b0c13aab59f75d05cbb202336
#include "core.h"
@ -90,15 +87,9 @@ static char *message_handler_list(pa_core *c) {
}
static int core_message_handler(const char *object_path, const char *message, const pa_json_object *parameters, char **response, void *userdata) {
<<<<<<< HEAD
pa_core *c;
pa_assert(c = (pa_core *) userdata);
=======
pa_core *c = userdata;
pa_assert(c);
>>>>>>> c1990dd02647405b0c13aab59f75d05cbb202336
pa_assert(message);
pa_assert(response);
pa_assert(pa_safe_streq(object_path, "/core"));

View file

@ -34,11 +34,7 @@
typedef struct pa_creds pa_creds;
typedef struct pa_cmsg_ancil_data pa_cmsg_ancil_data;
<<<<<<< HEAD
#if defined(SCM_CREDENTIALS) || defined(SCM_CREDS)
=======
#if (defined(SCM_CREDENTIALS) || defined(SCM_CREDS)) && !defined(OS_IS_DARWIN)
>>>>>>> c1990dd02647405b0c13aab59f75d05cbb202336
#define HAVE_CREDS 1

View file

@ -261,11 +261,7 @@ ssize_t pa_iochannel_read(pa_iochannel*io, void*data, size_t l) {
#ifdef HAVE_CREDS
<<<<<<< HEAD
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
=======
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
>>>>>>> c1990dd02647405b0c13aab59f75d05cbb202336
typedef struct cmsgcred pa_ucred_t;
#define SCM_CREDENTIALS SCM_CREDS
#else
@ -295,22 +291,14 @@ bool pa_iochannel_creds_supported(pa_iochannel *io) {
}
int pa_iochannel_creds_enable(pa_iochannel *io) {
<<<<<<< HEAD
#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
=======
#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__GNU__)
>>>>>>> c1990dd02647405b0c13aab59f75d05cbb202336
int t = 1;
#endif
pa_assert(io);
pa_assert(io->ifd >= 0);
<<<<<<< HEAD
#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
=======
#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__GNU__)
>>>>>>> c1990dd02647405b0c13aab59f75d05cbb202336
if (setsockopt(io->ifd, SOL_SOCKET, SO_PASSCRED, &t, sizeof(t)) < 0) {
pa_log_error("setsockopt(SOL_SOCKET, SO_PASSCRED): %s", pa_cstrerror(errno));
return -1;
@ -346,11 +334,7 @@ ssize_t pa_iochannel_write_with_creds(pa_iochannel*io, const void*data, size_t l
u = (pa_ucred_t*) CMSG_DATA(&cmsg.hdr);
<<<<<<< HEAD
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
=======
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
>>>>>>> c1990dd02647405b0c13aab59f75d05cbb202336
// the kernel fills everything
#else
u->pid = getpid();
@ -473,11 +457,7 @@ ssize_t pa_iochannel_read_with_ancil_data(pa_iochannel*io, void*data, size_t l,
pa_ucred_t u;
pa_assert(cmh->cmsg_len == CMSG_LEN(sizeof(pa_ucred_t)));
memcpy(&u, CMSG_DATA(cmh), sizeof(pa_ucred_t));
<<<<<<< HEAD
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
=======
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
>>>>>>> c1990dd02647405b0c13aab59f75d05cbb202336
ancil_data->creds.gid = u.cmcred_gid;
ancil_data->creds.uid = u.cmcred_uid;
#else

View file

@ -224,11 +224,7 @@ libpulsecore = shared_library('pulsecore-' + pa_version_major_minor,
install_rpath : privlibdir,
install_dir : privlibdir,
link_with : libpulsecore_simd_lib,
<<<<<<< HEAD
dependencies : [libm_dep, libpulsecommon_dep, ltdl_dep, shm_dep, sndfile_dep, database_dep, dbus_dep, libatomic_ops_dep, orc_dep, samplerate_dep, soxr_dep, speex_dep, x11_dep, libintl_dep, platform_dep, platform_socket_dep,],
=======
dependencies : [libm_dep, libpulsecommon_dep, ltdl_dep, shm_dep, sndfile_dep, database_dep, dbus_dep, libatomic_ops_dep, orc_dep, samplerate_dep, soxr_dep, speex_dep, x11_dep, libsystemd_dep, libintl_dep, platform_dep, tcpwrap_dep, platform_socket_dep,],
>>>>>>> c1990dd02647405b0c13aab59f75d05cbb202336
implicit_include_directories : false)
libpulsecore_dep = declare_dependency(link_with: libpulsecore)

View file

@ -131,10 +131,6 @@ int pa_message_handler_send_message(pa_core *c, const char *object_path, const c
if (message_parameters) {
parameters = pa_json_parse(message_parameters);
<<<<<<< HEAD
if (!parameters)
return -PA_ERR_INVALID;
=======
if (!parameters) {
char *wrapped_message_parameters;
@ -155,7 +151,6 @@ int pa_message_handler_send_message(pa_core *c, const char *object_path, const c
return -PA_ERR_INVALID;
}
}
>>>>>>> c1990dd02647405b0c13aab59f75d05cbb202336
}
/* The handler is expected to return an error code and may also

View file

@ -54,10 +54,6 @@ static const gchar* _g_get_application_name(void) PA_GCC_WEAKREF(g_get_applicati
static const gchar* _gtk_window_get_default_icon_name(void) PA_GCC_WEAKREF(gtk_window_get_default_icon_name);
#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
<<<<<<< HEAD
static const gchar* _gtk_window_get_default_icon_name(void) PA_GCC_WEAKREF(gtk_window_get_default_icon_name);
=======
>>>>>>> c1990dd02647405b0c13aab59f75d05cbb202336
static Display *_gdk_display PA_GCC_WEAKREF(gdk_display);
#endif
#endif

View file

@ -2061,8 +2061,6 @@ static void set_preferred_sink(pa_sink_input *i, const char *sink_name) {
pa_hook_fire(&i->core->hooks[PA_CORE_HOOK_SINK_INPUT_PREFERRED_SINK_CHANGED], i);
}
<<<<<<< HEAD
=======
/* Restores the render memblockq from the history memblockq during a move.
* Called from main context while the sink input is detached. */
static void restore_render_memblockq(pa_sink_input *i) {
@ -2146,7 +2144,6 @@ static void restore_render_memblockq(pa_sink_input *i) {
i->thread_info.dont_rewrite = true;
}
>>>>>>> c1990dd02647405b0c13aab59f75d05cbb202336
/* Called from main context */
int pa_sink_input_finish_move(pa_sink_input *i, pa_sink *dest, bool save) {
struct volume_factor_entry *v;

View file

@ -218,89 +218,6 @@ int pa_socket_set_sndbuf(int fd, size_t l) {
return 0;
}
<<<<<<< HEAD
#ifdef HAVE_SYS_UN_H
int pa_unix_socket_is_stale(const char *fn) {
struct sockaddr_un sa;
int fd = -1, ret = -1;
pa_assert(fn);
if ((fd = pa_socket_cloexec(PF_UNIX, SOCK_STREAM, 0)) < 0) {
pa_log("socket(): %s", pa_cstrerror(errno));
goto finish;
}
sa.sun_family = AF_UNIX;
strncpy(sa.sun_path, fn, sizeof(sa.sun_path)-1);
sa.sun_path[sizeof(sa.sun_path) - 1] = 0;
if (connect(fd, (struct sockaddr*) &sa, sizeof(sa)) < 0) {
#if !defined(OS_IS_WIN32)
if (errno == ECONNREFUSED)
ret = 1;
#else
if (WSAGetLastError() == WSAECONNREFUSED || WSAGetLastError() == WSAEINVAL)
ret = 1;
#endif
} else
ret = 0;
finish:
if (fd >= 0)
pa_close(fd);
return ret;
}
int pa_unix_socket_remove_stale(const char *fn) {
int r;
pa_assert(fn);
#ifdef HAVE_SYSTEMD_DAEMON
{
int n = sd_listen_fds(0);
if (n > 0) {
for (int i = 0; i < n; ++i) {
if (sd_is_socket_unix(SD_LISTEN_FDS_START + i, SOCK_STREAM, 1, fn, 0) > 0) {
/* This is a socket activated socket, therefore do not consider
* it stale. */
return 0;
}
}
}
}
#endif
if ((r = pa_unix_socket_is_stale(fn)) < 0)
return errno != ENOENT ? -1 : 0;
if (!r)
return 0;
/* Yes, here is a race condition. But who cares? */
if (unlink(fn) < 0)
return -1;
return 0;
}
#else /* HAVE_SYS_UN_H */
int pa_unix_socket_is_stale(const char *fn) {
return -1;
}
int pa_unix_socket_remove_stale(const char *fn) {
return -1;
}
#endif /* HAVE_SYS_UN_H */
=======
>>>>>>> c1990dd02647405b0c13aab59f75d05cbb202336
bool pa_socket_address_is_local(const struct sockaddr *sa) {
pa_assert(sa);