nleobject: It is wrong to update object->stop in set_property.

Summary: It must only be done when the object is commited.
We can do that in constructed though, as the changes will
anyway be commited when the object is added to a composition.

Also update the tests, as we set properties spearately then
check the stop, we can commit the source at its creation without
removing meaning from the tests.

Reviewers: thiblahute

Differential Revision: http://phabricator.freedesktop.org/D84
This commit is contained in:
Mathieu Duponchelle 2015-04-08 23:33:27 +02:00
parent 2e26a9e926
commit 506662e2dc
2 changed files with 11 additions and 2 deletions

View file

@ -88,6 +88,7 @@ static void nle_object_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static void nle_object_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
static void nle_object_constructed (GObject * object);
static GstStateChangeReturn nle_object_change_state (GstElement * element,
GstStateChange transition);
@ -114,6 +115,7 @@ nle_object_class_init (NleObjectClass * klass)
gobject_class->set_property = GST_DEBUG_FUNCPTR (nle_object_set_property);
gobject_class->get_property = GST_DEBUG_FUNCPTR (nle_object_get_property);
gobject_class->constructed = GST_DEBUG_FUNCPTR (nle_object_constructed);
gobject_class->dispose = GST_DEBUG_FUNCPTR (nle_object_dispose);
gstelement_class->change_state = GST_DEBUG_FUNCPTR (nle_object_change_state);
@ -514,8 +516,6 @@ nle_object_set_property (GObject * object, guint prop_id,
break;
}
GST_OBJECT_UNLOCK (object);
_update_stop (nleobject);
}
static void
@ -555,6 +555,14 @@ nle_object_get_property (GObject * object, guint prop_id,
}
}
static void
nle_object_constructed (GObject * object)
{
NleObject *nleobject = (NleObject *) object;
_update_stop (nleobject);
}
static GstStateChangeReturn
nle_object_change_state (GstElement * element, GstStateChange transition)
{

View file

@ -178,6 +178,7 @@ new_nle_src (const gchar * name, guint64 start, gint64 duration, gint priority)
g_object_set (G_OBJECT (nlesource),
"start", start,
"duration", duration, "inpoint", start, "priority", priority, NULL);
nle_object_commit (NLE_OBJECT (nlesource), FALSE);
return nlesource;
}