mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-02-11 04:27:56 -05:00
pipewire-pulse: add manager disconnect event
Drop client connections when pipewire goes away. pipewire-pulse daemon can remain running and pulseaudio clients will be able to connect again once pipewire is up and running.
This commit is contained in:
parent
df3ea8dafa
commit
7b773433f4
3 changed files with 32 additions and 0 deletions
|
|
@ -22,6 +22,7 @@
|
|||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "pipewire/core.h"
|
||||
#define NAME "pulse-server"
|
||||
|
||||
#include "config.h"
|
||||
|
|
@ -835,6 +836,21 @@ static void manager_metadata(void *data, struct pw_manager_object *o,
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
static void do_free_client(void *obj, void *data, int res, uint32_t id)
|
||||
{
|
||||
struct client *client = data;
|
||||
client_free(client);
|
||||
}
|
||||
|
||||
static void manager_disconnect(void *data)
|
||||
{
|
||||
struct client *client = data;
|
||||
pw_log_debug("manager_disconnect()");
|
||||
pw_work_queue_add(client->impl->work_queue, NULL, 0,
|
||||
do_free_client, client);
|
||||
}
|
||||
|
||||
static const struct pw_manager_events manager_events = {
|
||||
PW_VERSION_MANAGER_EVENTS,
|
||||
.sync = manager_sync,
|
||||
|
|
@ -842,6 +858,7 @@ static const struct pw_manager_events manager_events = {
|
|||
.updated = manager_updated,
|
||||
.removed = manager_removed,
|
||||
.metadata = manager_metadata,
|
||||
.disconnect = manager_disconnect
|
||||
};
|
||||
|
||||
static int do_set_client_name(struct client *client, uint32_t command, uint32_t tag, struct message *m)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue