summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
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);