wayland: Error check before using cached wl_display

A planar(or some other) buffer allocation may fail on the driver, then
the wayland connection becomes invalid, not able to send request or
receive any event. So we need to set up a new wayland connection if
there's an error detected on the cached wl_display.

https://bugzilla.gnome.org/show_bug.cgi?id=768761

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
This commit is contained in:
Jagyum Koo 2016-07-13 17:21:01 +09:00 committed by Víctor Manuel Jáquez Leal
parent f8eb0c84d9
commit 0d1d097273

View file

@ -207,6 +207,7 @@ gst_vaapi_display_wayland_open_display (GstVaapiDisplay * display,
GST_VAAPI_DISPLAY_WAYLAND_GET_PRIVATE (display); GST_VAAPI_DISPLAY_WAYLAND_GET_PRIVATE (display);
GstVaapiDisplayCache *const cache = GST_VAAPI_DISPLAY_CACHE (display); GstVaapiDisplayCache *const cache = GST_VAAPI_DISPLAY_CACHE (display);
const GstVaapiDisplayInfo *info; const GstVaapiDisplayInfo *info;
int dsp_error = 0;
if (!set_display_name (display, name)) if (!set_display_name (display, name))
return FALSE; return FALSE;
@ -214,6 +215,11 @@ gst_vaapi_display_wayland_open_display (GstVaapiDisplay * display,
info = gst_vaapi_display_cache_lookup_custom (cache, compare_display_name, info = gst_vaapi_display_cache_lookup_custom (cache, compare_display_name,
priv->display_name, g_display_types); priv->display_name, g_display_types);
if (info) { if (info) {
wl_display_roundtrip (info->native_display);
if ((dsp_error = wl_display_get_error (info->native_display)))
GST_ERROR ("wayland display error detected: %d", dsp_error);
}
if (info && !dsp_error) {
priv->wl_display = info->native_display; priv->wl_display = info->native_display;
priv->use_foreign_display = TRUE; priv->use_foreign_display = TRUE;
} else { } else {