Skip to content
Snippets Groups Projects
Commit eadb563c authored by Ayush Dey's avatar Ayush Dey Committed by Steve Lhomme
Browse files

pulse: revert "pulse: fail if the server is Pipewire"

This reverts commit 78563bdb.
parent f30b631f
No related branches found
No related tags found
1 merge request!6499services_discovery: pulse: revert "fail if the server is Pipewire"
Pipeline #544200 passed with stages
in 33 minutes and 48 seconds
......@@ -36,8 +36,6 @@
static int Open (vlc_object_t *);
static void Close (vlc_object_t *);
#include <vlc_modules.h>
VLC_SD_PROBE_HELPER("pulse", N_("Audio capture"), SD_CAT_DEVICES);
vlc_module_begin ()
......@@ -57,29 +55,12 @@ typedef struct
void *root_card;
pa_context *context;
pa_threaded_mainloop *mainloop;
bool is_pipewire;
} services_discovery_sys_t;
static void SourceCallback(pa_context *, const pa_source_info *, int, void *);
static void ContextCallback(pa_context *, pa_subscription_event_type_t,
uint32_t, void *);
static void server_info_cb(pa_context *ctx, const pa_server_info *info,
void *userdata)
{
services_discovery_t *sd = userdata;
msg_Dbg(sd, "server %s version %s on %s@%s", info->server_name,
info->server_version, info->user_name, info->host_name);
services_discovery_sys_t *sys = sd->p_sys;
sys->is_pipewire = strcasestr(info->server_name, "pipewire") != NULL;
pa_threaded_mainloop_signal(sys->mainloop, 0);
(void) ctx;
}
static int Open (vlc_object_t *obj)
{
services_discovery_t *sd = (services_discovery_t *)obj;
......@@ -102,27 +83,10 @@ static int Open (vlc_object_t *obj)
sys->context = ctx;
sys->root = NULL;
sys->root_card = NULL;
sys->is_pipewire = false;
pa_threaded_mainloop_lock(sys->mainloop);
op = pa_context_get_server_info(sys->context, server_info_cb, sd);
if (likely(op != NULL))
{
while (pa_operation_get_state(op) == PA_OPERATION_RUNNING)
pa_threaded_mainloop_wait(sys->mainloop);
if (sys->is_pipewire && module_exists("pipewirelist"))
{
msg_Dbg(sd, "refusing to use PipeWire");
pa_threaded_mainloop_unlock(sys->mainloop);
vlc_pa_disconnect(obj, sys->context, sys->mainloop);
free(sys);
return -ENOTSUP;
}
pa_operation_unref(op);
}
/* Subscribe for source events */
const pa_subscription_mask_t mask = PA_SUBSCRIPTION_MASK_SOURCE;
pa_threaded_mainloop_lock (sys->mainloop);
pa_context_set_subscribe_callback (ctx, ContextCallback, sd);
op = pa_context_subscribe (ctx, mask, NULL, NULL);
if (likely(op != NULL))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment