From 909185d49e54a83bf0740a4fdb5112833fea5c05 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 7 Jan 2014 01:06:28 +0100 Subject: wayland: silence annoying libwayland-client message libwayland-client contains the following code [1]: runtime_dir = getenv("XDG_RUNTIME_DIR"); if (!runtime_dir) { fprintf(stderr, "error: XDG_RUNTIME_DIR not set in the environment.\n"); This means this message will unconditionally and unavoidably be printed if XDG_RUNTIME_DIR is not set. Since mpv is a terminal program, and we want to avoid unnecessary output, work it around by not attempting to use wayland if this environment variable is not set. [1] http://cgit.freedesktop.org/wayland/wayland/tree/src/wayland-client.c#n636 (cd0dccd01e16fa404e03974d30ded3aebdb1c4bc) --- video/out/wayland_common.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 03aff90955..c77a608d69 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -632,6 +632,9 @@ static void shedule_resize(struct vo_wayland_state *wl, static bool create_display (struct vo_wayland_state *wl) { + if (wl->vo->probing && !getenv("XDG_RUNTIME_DIR")) + return false; + wl->display.display = wl_display_connect(NULL); if (!wl->display.display) { -- cgit v1.2.3