aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2020-11-02 17:07:47 +0200
committerMarius Vlad <marius.vlad@collabora.com>2020-12-01 13:07:57 +0200
commitd68ed0af3de3ee672c5ee38a7dff9e2c37ece1d5 (patch)
tree9cbb833de634215bbcc320c8724df781dd2b90fd /src
parent8fcbed84cfefcfe648584941587e6d06abf59c3e (diff)
As we're running in a child process, substitute returns with exits to signal the parent correctly. Bug-AGL: SPEC-3675 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I6270177572f850214b00f7ef204564af35a7a09e
Diffstat (limited to 'src')
-rw-r--r--src/wth-receiver-gst-shm.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/src/wth-receiver-gst-shm.c b/src/wth-receiver-gst-shm.c
index 50efe0b..be21f6c 100644
--- a/src/wth-receiver-gst-shm.c
+++ b/src/wth-receiver-gst-shm.c
@@ -417,6 +417,24 @@ static const struct wl_callback_listener frame_listener = {
redraw
};
+static struct client *to_client(struct surface *surface)
+{
+ struct ivisurface *ivisurface = NULL;
+ struct client *client = NULL;
+
+ if (!surface)
+ return NULL;
+
+ if (!surface->ivisurf)
+ return NULL;
+
+ ivisurface = surface->ivisurf;
+ if (!ivisurface->appid)
+ return client;
+
+ return ivisurface->appid->client;
+}
+
static void
redraw(void *data, struct wl_callback *callback, uint32_t time)
{
@@ -425,10 +443,12 @@ redraw(void *data, struct wl_callback *callback, uint32_t time)
buffer = get_next_buffer(window);
if (!buffer) {
+ struct client *client = to_client(window->receiver_surf);
fprintf(stderr,
!callback ? "Failed to create the first buffer.\n" :
"Both buffers busy at redraw(). Server bug?\n");
- abort();
+ client->pid_destroying = true;
+ exit(EXIT_FAILURE);
}
// do the actual painting
@@ -658,7 +678,7 @@ create_display(void)
display = malloc(sizeof *display);
if (display == NULL) {
wth_error("out of memory\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
display->display = wl_display_connect(NULL);
assert(display->display);
@@ -819,8 +839,13 @@ wth_receiver_weston_main(struct window *window, const char *app_id, int port)
/* parse the pipeline */
gstctx.pipeline = gst_parse_launch(pipeline, &gerror);
- if (!gstctx.pipeline)
+ if (!gstctx.pipeline) {
+ struct client *client = to_client(window->receiver_surf);
+
fprintf(stderr, "Could not create gstreamer pipeline.\n");
+ client->pid_destroying = true;
+ exit(EXIT_FAILURE);
+ }
gstctx.bus = gst_element_get_bus(gstctx.pipeline);
gst_bus_add_signal_watch(gstctx.bus);