applemedia: Fail cleanly instead of crashing if obtaining a GL display failed

https://bugzilla.gnome.org/show_bug.cgi?id=777742
This commit is contained in:
Sebastian Dröge 2017-01-26 15:35:11 +02:00
parent f6b81a6125
commit 926c9a243d

View file

@ -70,6 +70,9 @@ gst_gl_context_helper_ensure_context (GstGLContextHelper * ctxh)
gst_gl_ensure_element_data (ctxh->element, &ctxh->display, gst_gl_ensure_element_data (ctxh->element, &ctxh->display,
&ctxh->other_context); &ctxh->other_context);
if (!ctxh->display)
goto display_error;
context = _find_local_gl_context (ctxh); context = _find_local_gl_context (ctxh);
if (context) { if (context) {
GST_INFO_OBJECT (ctxh->element, "found local context %p, old context %p", GST_INFO_OBJECT (ctxh->element, "found local context %p, old context %p",
@ -107,4 +110,12 @@ context_error:
return; return;
} }
display_error:
{
GST_ELEMENT_ERROR (ctxh->element, RESOURCE, NOT_FOUND,
("Failed to obtain display"), (NULL));
return;
}
} }