diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2023-02-17 00:21:59 +0200 |
---|---|---|
committer | Marius Vlad <marius.vlad@collabora.com> | 2023-05-16 10:44:25 +0300 |
commit | 70479268340f50cebe3f1dec45d51c1ec5b140e7 (patch) | |
tree | 615cc51fdf21a7e3e963584b8e33515c41fcc014 | |
parent | 0849a9b3c843c05c7b180a04737317f8f5a60725 (diff) | |
download | weston-70479268340f50cebe3f1dec45d51c1ec5b140e7.tar.gz |
pipewire-plugin: Check virtual outputs/remoting instance
Similarly to remoting plug-in in commit "Check virtual outputs/remoting
instance" this avoids touching the pipewire instance, and with it, the
pipewire output.
Includes a note to point up what should be done about by
checking out https://gitlab.freedesktop.org/wayland/weston/-/issues/591.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
(cherry picked from commit 6617deebec5586c4d8c61097b7e51dd53c4e4624)
-rw-r--r-- | pipewire/pipewire-plugin.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/pipewire/pipewire-plugin.c b/pipewire/pipewire-plugin.c index b8dad03e..748ba492 100644 --- a/pipewire/pipewire-plugin.c +++ b/pipewire/pipewire-plugin.c @@ -149,6 +149,16 @@ lookup_pipewire_output(struct weston_output *base_output) struct weston_pipewire *pipewire = weston_pipewire_get(c); struct pipewire_output *output; + /* XXX: This could happen on the compositor shutdown path with our + * destroy listener being removed, and pipewire_output_destroy() being + * called as a virtual destructor. + * + * See https://gitlab.freedesktop.org/wayland/weston/-/issues/591 for + * an alternative to the shutdown sequence. + */ + if (!pipewire) + return NULL; + wl_list_for_each(output, &pipewire->output_list, link) { if (output->output == base_output) return output; @@ -310,6 +320,9 @@ pipewire_output_destroy(struct weston_output *base_output) struct pipewire_output *output = lookup_pipewire_output(base_output); struct weston_mode *mode, *next; + if (!output) + return; + weston_head_release(output->head); wl_list_for_each_safe(mode, next, &base_output->mode_list, link) { |