mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-30 04:00:37 +00:00
[MOVED FROM GOOD] sys/directdraw/gstdirectdrawsink.c: Properly chain up finalize functions. Fixes bug #515980.
Original commit message from CVS: * sys/directdraw/gstdirectdrawsink.c: (gst_ddrawsurface_class_init), (gst_ddrawsurface_finalize), (gst_directdraw_sink_finalize): Properly chain up finalize functions. Fixes bug #515980.
This commit is contained in:
parent
c67d722907
commit
e7a9a0ef4b
1 changed files with 8 additions and 1 deletions
|
@ -214,6 +214,7 @@ gst_directdraw_sink_init_interfaces (GType type)
|
||||||
|
|
||||||
/* Subclass of GstBuffer which manages buffer_pool surfaces lifetime */
|
/* Subclass of GstBuffer which manages buffer_pool surfaces lifetime */
|
||||||
static void gst_ddrawsurface_finalize (GstMiniObject * mini_object);
|
static void gst_ddrawsurface_finalize (GstMiniObject * mini_object);
|
||||||
|
static GstBufferClass *ddrawsurface_parent_class = NULL;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_ddrawsurface_init (GstDDrawSurface * surface, gpointer g_class)
|
gst_ddrawsurface_init (GstDDrawSurface * surface, gpointer g_class)
|
||||||
|
@ -232,6 +233,8 @@ gst_ddrawsurface_class_init (gpointer g_class, gpointer class_data)
|
||||||
{
|
{
|
||||||
GstMiniObjectClass *mini_object_class = GST_MINI_OBJECT_CLASS (g_class);
|
GstMiniObjectClass *mini_object_class = GST_MINI_OBJECT_CLASS (g_class);
|
||||||
|
|
||||||
|
ddrawsurface_parent_class = g_type_class_peek_parent (g_class);
|
||||||
|
|
||||||
mini_object_class->finalize = GST_DEBUG_FUNCPTR (gst_ddrawsurface_finalize);
|
mini_object_class->finalize = GST_DEBUG_FUNCPTR (gst_ddrawsurface_finalize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -283,7 +286,7 @@ gst_ddrawsurface_finalize (GstMiniObject * mini_object)
|
||||||
surface->width, surface->height, ddrawsink->video_width,
|
surface->width, surface->height, ddrawsink->video_width,
|
||||||
ddrawsink->video_height);
|
ddrawsink->video_height);
|
||||||
gst_directdraw_sink_surface_destroy (ddrawsink, surface);
|
gst_directdraw_sink_surface_destroy (ddrawsink, surface);
|
||||||
|
GST_MINI_OBJECT_CLASS (ddrawsurface_parent_class)->finalize (mini_object);
|
||||||
} else {
|
} else {
|
||||||
/* In that case we can reuse the image and add it to our image pool. */
|
/* In that case we can reuse the image and add it to our image pool. */
|
||||||
GST_CAT_INFO_OBJECT (directdrawsink_debug, ddrawsink,
|
GST_CAT_INFO_OBJECT (directdrawsink_debug, ddrawsink,
|
||||||
|
@ -296,10 +299,12 @@ gst_ddrawsurface_finalize (GstMiniObject * mini_object)
|
||||||
ddrawsink->buffer_pool = g_slist_prepend (ddrawsink->buffer_pool, surface);
|
ddrawsink->buffer_pool = g_slist_prepend (ddrawsink->buffer_pool, surface);
|
||||||
g_mutex_unlock (ddrawsink->pool_lock);
|
g_mutex_unlock (ddrawsink->pool_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
no_sink:
|
no_sink:
|
||||||
GST_CAT_WARNING (directdrawsink_debug, "no sink found");
|
GST_CAT_WARNING (directdrawsink_debug, "no sink found");
|
||||||
|
GST_MINI_OBJECT_CLASS (ddrawsurface_parent_class)->finalize (mini_object);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -407,6 +412,8 @@ gst_directdraw_sink_finalize (GObject * object)
|
||||||
if (ddrawsink->setup) {
|
if (ddrawsink->setup) {
|
||||||
gst_directdraw_sink_cleanup (ddrawsink);
|
gst_directdraw_sink_cleanup (ddrawsink);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue