Hi,
Please try this patch:
diff --git a/ext/eglgles/gstegladaptation.c b/ext/eglgles/gstegladaptation.c
index 2498467..1cb25e4 100644
--- a/ext/eglgles/gstegladaptation.c
+++ b/ext/eglgles/gstegladaptation.c
@@ -690,7 +690,8 @@ void
gst_egl_adaptation_context_free (GstEglAdaptationContext * ctx)
{
gst_egl_adaptation_deinit (ctx);
- gst_object_unref (ctx->element);
+ if (GST_OBJECT_REFCOUNT(ctx->element))
+ gst_object_unref (ctx->element);
g_free (ctx);
}
diff --git a/ext/eglgles/gsteglglessink.c b/ext/eglgles/gsteglglessink.c
index f5811a4..b41c963 100644
--- a/ext/eglgles/gsteglglessink.c
+++ b/ext/eglgles/gsteglglessink.c
@@ -382,8 +382,6 @@ gst_egl_image_buffer_pool_set_config (GstBufferPool * bpool,
if (!gst_buffer_pool_config_get_allocator (config, &pool->allocator,
&pool->params))
return FALSE;
- if (pool->allocator)
- gst_object_ref (pool->allocator);
pool->add_metavideo =
gst_buffer_pool_config_has_option (config,
@@ -2471,8 +2469,10 @@ gst_eglglessink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
/* First the default allocator */
if (!gst_egl_image_memory_is_mappable ()) {
allocator = gst_allocator_find (NULL);
- gst_query_add_allocation_param (query, allocator, ¶ms);
- gst_object_unref (allocator);
+ if (allocator) {
+ gst_query_add_allocation_param (query, allocator, ¶ms);
+ gst_object_unref (allocator);
+ }
}
allocator = gst_egl_image_allocator_obtain ();
@@ -2885,6 +2885,8 @@ gst_eglglessink_close (GstEglGlesSink * eglglessink)
}
#endif
+ if (GST_OBJECT_REFCOUNT(eglglessink))
+ gst_object_unref (eglglessink);
return TRUE;
}
diff --git a/gst-libs/gst/egl/egl.c b/gst-libs/gst/egl/egl.c
index d539745..af54ad3 100644
--- a/gst-libs/gst/egl/egl.c
+++ b/gst-libs/gst/egl/egl.c
@@ -269,13 +269,10 @@ gst_egl_image_allocator_init_instance (gpointer data)
GstAllocator *
gst_egl_image_allocator_obtain (void)
{
- static GOnce once = G_ONCE_INIT;
+ GstAllocator *allocator;
- g_once (&once, gst_egl_image_allocator_init_instance, NULL);
-
- g_return_val_if_fail (once.retval != NULL, NULL);
-
- return GST_ALLOCATOR (g_object_ref (once.retval));
+ allocator = gst_egl_image_allocator_init_instance(NULL);
+ return GST_ALLOCATOR (g_object_ref (allocator));
}
GstMemory *
In default code it initializes allocator into static object. Have to dynamically initialize the object in every launch.