/* we always allow setting the master to NULL */
if (master && !GST_OBJECT_FLAG_IS_SET (clock, GST_CLOCK_FLAG_CAN_SET_MASTER))
goto not_supported;
-
GST_CAT_DEBUG_OBJECT (GST_CAT_CLOCK, clock,
"slaving %p to master clock %p", clock, master);
- master_p = &clock->master;
- gst_object_replace ((GstObject **) master_p, (GstObject *) master);
GST_OBJECT_UNLOCK (clock);
GST_CLOCK_SLAVE_LOCK (clock);
}
GST_CLOCK_SLAVE_UNLOCK (clock);
+ GST_OBJECT_LOCK (clock);
+ master_p = &clock->master;
+ gst_object_replace ((GstObject **) master_p, (GstObject *) master);
+ GST_OBJECT_UNLOCK (clock);
+
return TRUE;
/* ERRORS */