mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
gl: unref display/other-context in the correct place
Otherwise state changes from PLAYING->READY->PAUSED will cause there to to be no display configured on the element. https://bugzilla.gnome.org/show_bug.cgi?id=748405
This commit is contained in:
parent
52a40dfc48
commit
8930bf7c07
1 changed files with 11 additions and 22 deletions
|
@ -247,8 +247,6 @@ static gboolean gst_gl_base_mixer_set_allocation (GstGLBaseMixer * mix,
|
|||
GstBufferPool * pool, GstAllocator * allocator,
|
||||
GstAllocationParams * params, GstQuery * query);
|
||||
|
||||
static void gst_gl_base_mixer_finalize (GObject * object);
|
||||
|
||||
static void
|
||||
gst_gl_base_mixer_class_init (GstGLBaseMixerClass * klass)
|
||||
{
|
||||
|
@ -266,8 +264,6 @@ gst_gl_base_mixer_class_init (GstGLBaseMixerClass * klass)
|
|||
|
||||
g_type_class_add_private (klass, sizeof (GstGLBaseMixerPrivate));
|
||||
|
||||
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_gl_base_mixer_finalize);
|
||||
|
||||
gobject_class->get_property = gst_gl_base_mixer_get_property;
|
||||
gobject_class->set_property = gst_gl_base_mixer_set_property;
|
||||
|
||||
|
@ -313,19 +309,6 @@ gst_gl_base_mixer_init (GstGLBaseMixer * mix)
|
|||
gst_gl_base_mixer_reset (mix);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_base_mixer_finalize (GObject * object)
|
||||
{
|
||||
GstGLBaseMixer *mix = GST_GL_BASE_MIXER (object);
|
||||
|
||||
if (mix->priv->other_context) {
|
||||
gst_object_unref (mix->priv->other_context);
|
||||
mix->priv->other_context = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_gl_base_mixer_set_context (GstElement * element, GstContext * context)
|
||||
{
|
||||
|
@ -674,11 +657,6 @@ gst_gl_base_mixer_stop (GstAggregator * agg)
|
|||
mix->priv->pool = NULL;
|
||||
}
|
||||
|
||||
if (mix->display) {
|
||||
gst_object_unref (mix->display);
|
||||
mix->display = NULL;
|
||||
}
|
||||
|
||||
if (mix->context) {
|
||||
gst_object_unref (mix->context);
|
||||
mix->context = NULL;
|
||||
|
@ -717,6 +695,17 @@ gst_gl_base_mixer_change_state (GstElement * element, GstStateChange transition)
|
|||
return ret;
|
||||
|
||||
switch (transition) {
|
||||
case GST_STATE_CHANGE_READY_TO_NULL:
|
||||
if (mix->priv->other_context) {
|
||||
gst_object_unref (mix->priv->other_context);
|
||||
mix->priv->other_context = NULL;
|
||||
}
|
||||
|
||||
if (mix->display) {
|
||||
gst_object_unref (mix->display);
|
||||
mix->display = NULL;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue