From 21275caae58965ffcc5d14d85ea919fbfda78298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 13 Oct 2014 13:27:11 +0200 Subject: [PATCH] glmixer: 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/gstglmixer.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ext/gl/gstglmixer.c b/ext/gl/gstglmixer.c index 0095437dcf..5857410599 100644 --- a/ext/gl/gstglmixer.c +++ b/ext/gl/gstglmixer.c @@ -463,7 +463,13 @@ gst_gl_mixer_init (GstGLMixer * mix) static void gst_gl_mixer_finalize (GObject * object) { - GstGLMixerPrivate *priv = GST_GL_MIXER (object)->priv; + GstGLMixer *mix = GST_GL_MIXER (object); + GstGLMixerPrivate *priv = mix->priv; + + if (mix->other_context) { + gst_object_unref (mix->other_context); + mix->other_context = NULL; + } g_mutex_clear (&priv->gl_resource_lock); g_cond_clear (&priv->gl_resource_cond); @@ -1142,11 +1148,6 @@ gst_gl_mixer_stop (GstAggregator * agg) mix->context = NULL; } - if (mix->other_context) { - gst_object_unref (mix->other_context); - mix->other_context = NULL; - } - gst_gl_mixer_reset (mix); return TRUE;