From 2715daebf391f34996a2f5ce602c99684d269bec Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Sat, 7 Jan 2017 20:11:13 +0100 Subject: [PATCH] gdkpixbufoverlay: handle setting NULL gdkpixbuf ... which is a clearer way to clear any current overlay, other than fiddling with alpha or positioning properties to make it virtually go away. --- ext/gdk_pixbuf/gstgdkpixbufoverlay.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ext/gdk_pixbuf/gstgdkpixbufoverlay.c b/ext/gdk_pixbuf/gstgdkpixbufoverlay.c index b765091..635dd5f 100644 --- a/ext/gdk_pixbuf/gstgdkpixbufoverlay.c +++ b/ext/gdk_pixbuf/gstgdkpixbufoverlay.c @@ -295,8 +295,13 @@ gst_gdk_pixbuf_overlay_set_property (GObject * object, guint property_id, if (overlay->pixbuf != NULL) g_object_unref (overlay->pixbuf); - overlay->pixbuf = g_object_ref (pixbuf); - gst_gdk_pixbuf_overlay_set_pixbuf (overlay, g_object_ref (pixbuf)); + if (pixbuf) { + overlay->pixbuf = g_object_ref (pixbuf); + gst_gdk_pixbuf_overlay_set_pixbuf (overlay, g_object_ref (pixbuf)); + } else { + overlay->pixbuf = NULL; + gst_buffer_replace (&overlay->pixels, NULL); + } break; } case PROP_OFFSET_X: -- 2.7.4