mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 07:42:23 +02:00
plugin: Always make sure we have Gdk display
Give up creating GL context in an unlikely situation that there is no default display
This commit is contained in:
@@ -109,6 +109,11 @@ retrieve_gl_context_on_main (GstClapperGLBaseImporter *self)
|
|||||||
|
|
||||||
gdk_display = gdk_display_get_default ();
|
gdk_display = gdk_display_get_default ();
|
||||||
|
|
||||||
|
if (G_UNLIKELY (!gdk_display)) {
|
||||||
|
GST_ERROR_OBJECT (self, "Could not retrieve Gdk display");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(gdk_context = gdk_display_create_gl_context (gdk_display, &error))) {
|
if (!(gdk_context = gdk_display_create_gl_context (gdk_display, &error))) {
|
||||||
GST_ERROR_OBJECT (self, "Error creating Gdk GL context: %s",
|
GST_ERROR_OBJECT (self, "Error creating Gdk GL context: %s",
|
||||||
error ? error->message : "No error set by Gdk");
|
error ? error->message : "No error set by Gdk");
|
||||||
|
Reference in New Issue
Block a user