mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
clock: Don't allow setting an unsynced clock as master
This commit is contained in:
parent
ab827eca2e
commit
2f776d679f
1 changed files with 11 additions and 0 deletions
|
@ -1230,6 +1230,9 @@ gst_clock_set_master (GstClock * clock, GstClock * master)
|
|||
/* 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;
|
||||
if (master && !gst_clock_is_synced (master))
|
||||
goto master_not_synced;
|
||||
|
||||
GST_CAT_DEBUG_OBJECT (GST_CAT_CLOCK, clock,
|
||||
"slaving %p to master clock %p", clock, master);
|
||||
GST_OBJECT_UNLOCK (clock);
|
||||
|
@ -1270,6 +1273,14 @@ not_supported:
|
|||
GST_OBJECT_UNLOCK (clock);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
master_not_synced:
|
||||
{
|
||||
GST_CAT_DEBUG_OBJECT (GST_CAT_CLOCK, master,
|
||||
"master clock is not synced yet");
|
||||
GST_OBJECT_UNLOCK (clock);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue