mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
properly get rid of clocks on disposal - be parent of own clock
Original commit message from CVS: properly get rid of clocks on disposal - be parent of own clock
This commit is contained in:
parent
d271f13fd1
commit
d1e45d83b9
2 changed files with 38 additions and 1 deletions
|
@ -39,6 +39,7 @@ static GstElementDetails gst_osssink_details = {
|
|||
|
||||
static void gst_osssink_class_init (GstOssSinkClass *klass);
|
||||
static void gst_osssink_init (GstOssSink *osssink);
|
||||
static void gst_osssink_dispose (GObject *object);
|
||||
static void gst_osssink_finalize (GObject *object);
|
||||
|
||||
static GstElementStateReturn gst_osssink_change_state (GstElement *element);
|
||||
|
@ -147,6 +148,16 @@ gst_osssink_get_bufferpool (GstPad *pad)
|
|||
return oss->sinkpool;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_osssink_dispose (GObject *object)
|
||||
{
|
||||
GstOssSink *osssink = (GstOssSink *) object;
|
||||
|
||||
gst_object_unparent (GST_OBJECT (osssink->provided_clock));
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_osssink_finalize (GObject *object)
|
||||
{
|
||||
|
@ -192,6 +203,7 @@ gst_osssink_class_init (GstOssSinkClass *klass)
|
|||
|
||||
gobject_class->set_property = gst_osssink_set_property;
|
||||
gobject_class->get_property = gst_osssink_get_property;
|
||||
gobject_class->dispose = gst_osssink_dispose;
|
||||
gobject_class->finalize = gst_osssink_finalize;
|
||||
|
||||
gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_osssink_change_state);
|
||||
|
@ -223,6 +235,7 @@ gst_osssink_init (GstOssSink *osssink)
|
|||
osssink->sync = TRUE;
|
||||
osssink->sinkpool = NULL;
|
||||
osssink->provided_clock = GST_CLOCK (gst_oss_clock_new ("ossclock", gst_osssink_get_time, osssink));
|
||||
gst_object_set_parent (GST_OBJECT (osssink->provided_clock), GST_OBJECT (osssink));
|
||||
osssink->handled = 0;
|
||||
|
||||
GST_FLAG_SET (osssink, GST_ELEMENT_THREAD_SUGGESTED);
|
||||
|
@ -623,4 +636,3 @@ gst_osssink_factory_init (GstPlugin *plugin)
|
|||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -87,6 +87,8 @@ GST_PAD_TEMPLATE_FACTORY (osssrc_src_factory,
|
|||
|
||||
static void gst_osssrc_class_init (GstOssSrcClass *klass);
|
||||
static void gst_osssrc_init (GstOssSrc *osssrc);
|
||||
static void gst_osssrc_dispose (GObject *object);
|
||||
static void gst_osssrc_finalize (GObject *object);
|
||||
|
||||
static GstPadLinkReturn gst_osssrc_srcconnect (GstPad *pad, GstCaps *caps);
|
||||
static const GstFormat* gst_osssrc_get_formats (GstPad *pad);
|
||||
|
@ -162,6 +164,8 @@ gst_osssrc_class_init (GstOssSrcClass *klass)
|
|||
|
||||
gobject_class->set_property = gst_osssrc_set_property;
|
||||
gobject_class->get_property = gst_osssrc_get_property;
|
||||
gobject_class->dispose = gst_osssrc_dispose;
|
||||
gobject_class->finalize = gst_osssrc_finalize;
|
||||
|
||||
gstelement_class->change_state = gst_osssrc_change_state;
|
||||
gstelement_class->send_event = gst_osssrc_send_event;
|
||||
|
@ -195,8 +199,29 @@ gst_osssrc_init (GstOssSrc *osssrc)
|
|||
osssrc->provided_clock = GST_CLOCK (gst_oss_clock_new ("ossclock",
|
||||
gst_osssrc_get_time,
|
||||
osssrc));
|
||||
gst_object_set_parent (GST_OBJECT (osssrc->provided_clock), GST_OBJECT (osssrc));
|
||||
|
||||
osssrc->clock = NULL;
|
||||
}
|
||||
static void
|
||||
gst_osssrc_dispose (GObject *object)
|
||||
{
|
||||
GstOssSrc *osssrc = (GstOssSrc *) object;
|
||||
|
||||
gst_object_unparent (GST_OBJECT (osssrc->provided_clock));
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->dispose (object);
|
||||
}
|
||||
static void
|
||||
gst_osssrc_finalize (GObject *object)
|
||||
{
|
||||
GstOssSrc *osssrc = (GstOssSrc *) object;
|
||||
|
||||
g_free (osssrc->common.device);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
|
||||
static GstPadLinkReturn
|
||||
gst_osssrc_srcconnect (GstPad *pad, GstCaps *caps)
|
||||
|
|
Loading…
Reference in a new issue