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)
dev
Marius Vlad 2 years ago
parent 0849a9b3c8
commit 7047926834
  1. 13
      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 weston_pipewire *pipewire = weston_pipewire_get(c);
struct pipewire_output *output; 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) { wl_list_for_each(output, &pipewire->output_list, link) {
if (output->output == base_output) if (output->output == base_output)
return 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 pipewire_output *output = lookup_pipewire_output(base_output);
struct weston_mode *mode, *next; struct weston_mode *mode, *next;
if (!output)
return;
weston_head_release(output->head); weston_head_release(output->head);
wl_list_for_each_safe(mode, next, &base_output->mode_list, link) { wl_list_for_each_safe(mode, next, &base_output->mode_list, link) {

Loading…
Cancel
Save