From 22a1ec13b62251dec069b567a7a965f3ef787a2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 13 Oct 2014 13:28:57 +0200 Subject: [PATCH] glimagesink: Only finalize the other context in finalize() Otherwise we change a value of a property when going to READY state, which is unexpected behaviour. --- ext/gl/gstglimagesink.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c index 07c40875a3..33dd96bb14 100644 --- a/ext/gl/gstglimagesink.c +++ b/ext/gl/gstglimagesink.c @@ -417,6 +417,11 @@ gst_glimage_sink_finalize (GObject * object) g_mutex_clear (&glimage_sink->drawing_lock); + if (glimage_sink->other_context) { + gst_object_unref (glimage_sink->other_context); + glimage_sink->other_context = NULL; + } + g_free (glimage_sink->display_name); GST_DEBUG ("finalized"); @@ -588,11 +593,6 @@ gst_glimage_sink_stop (GstBaseSink * bsink) glimage_sink->pool = NULL; } - if (glimage_sink->other_context) { - gst_object_unref (glimage_sink->other_context); - glimage_sink->other_context = NULL; - } - return TRUE; } @@ -684,11 +684,6 @@ gst_glimage_sink_change_state (GstElement * element, GstStateChange transition) glimage_sink->context = NULL; } - if (glimage_sink->other_context) { - gst_object_unref (glimage_sink->other_context); - glimage_sink->other_context = NULL; - } - if (glimage_sink->display) { gst_object_unref (glimage_sink->display); glimage_sink->display = NULL;