mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 17:20:36 +00:00
typefind: cleanup (un)reffing of several objects.
By using these functions, we can shave off a few lines, and make the intent of that line more clear.
This commit is contained in:
parent
b92e34ebfd
commit
cf3fdbe4c0
1 changed files with 4 additions and 15 deletions
|
@ -221,9 +221,7 @@ gst_type_find_element_emit_have_type (GstTypeFindElement * typefind,
|
||||||
* honored in all "have-type" signal handlers.
|
* honored in all "have-type" signal handlers.
|
||||||
*/
|
*/
|
||||||
GST_OBJECT_LOCK (typefind);
|
GST_OBJECT_LOCK (typefind);
|
||||||
if (typefind->caps)
|
gst_caps_replace (&typefind->caps, caps);
|
||||||
gst_caps_unref (typefind->caps);
|
|
||||||
typefind->caps = gst_caps_ref (caps);
|
|
||||||
GST_OBJECT_UNLOCK (typefind);
|
GST_OBJECT_UNLOCK (typefind);
|
||||||
|
|
||||||
/* Only store the caps event at this point. We give signal handlers
|
/* Only store the caps event at this point. We give signal handlers
|
||||||
|
@ -340,15 +338,8 @@ gst_type_find_element_dispose (GObject * object)
|
||||||
{
|
{
|
||||||
GstTypeFindElement *typefind = GST_TYPE_FIND_ELEMENT (object);
|
GstTypeFindElement *typefind = GST_TYPE_FIND_ELEMENT (object);
|
||||||
|
|
||||||
if (typefind->adapter) {
|
gst_clear_object (&typefind->adapter);
|
||||||
g_object_unref (typefind->adapter);
|
gst_clear_caps (&typefind->force_caps);
|
||||||
typefind->adapter = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typefind->force_caps) {
|
|
||||||
gst_caps_unref (typefind->force_caps);
|
|
||||||
typefind->force_caps = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (parent_class)->dispose (object);
|
G_OBJECT_CLASS (parent_class)->dispose (object);
|
||||||
}
|
}
|
||||||
|
@ -367,9 +358,7 @@ gst_type_find_element_set_property (GObject * object, guint prop_id,
|
||||||
break;
|
break;
|
||||||
case PROP_FORCE_CAPS:
|
case PROP_FORCE_CAPS:
|
||||||
GST_OBJECT_LOCK (typefind);
|
GST_OBJECT_LOCK (typefind);
|
||||||
if (typefind->force_caps)
|
gst_caps_take (&typefind->force_caps, g_value_dup_boxed (value));
|
||||||
gst_caps_unref (typefind->force_caps);
|
|
||||||
typefind->force_caps = g_value_dup_boxed (value);
|
|
||||||
GST_OBJECT_UNLOCK (typefind);
|
GST_OBJECT_UNLOCK (typefind);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue