mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
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:
parent
f6b81a6125
commit
926c9a243d
1 changed files with 11 additions and 0 deletions
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue