diff options
author | Jan Schmidt <jan@centricular.com> | 2018-10-11 06:34:40 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2018-11-08 00:09:38 +0300 |
commit | 9dafa0cb032d386f9a0094479d20c71c59181663 (patch) | |
tree | 1ad861328796e247a694277d5ff2121d72965c9a | |
parent | 57ae8a55690f2d9851585432889c8dd86b591b50 (diff) |
ptp clock: Wait for ANNOUNCE before selecting a master
Previously, with opportunistic sync we'd track a master
clock as soon as we see a SYNC message, and hence sync up
faster, but then we'd announce we're synched before seeing
the ANNOUNCE, leaving the clock details like grandmaster-clock
empty.
A better way is to start tracking the clock opportunistically,
but not announce we're synched until we've also seen the ANNOUNCE.
-rw-r--r-- | libs/gst/net/gstptpclock.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/gst/net/gstptpclock.c b/libs/gst/net/gstptpclock.c index e1e0955462..41eb05d68b 100644 --- a/libs/gst/net/gstptpclock.c +++ b/libs/gst/net/gstptpclock.c @@ -2371,8 +2371,9 @@ gst_ptp_clock_ensure_domain_clock (GstPtpClock * self) for (l = domain_clocks; l; l = l->next) { PtpDomainData *clock_data = l->data; - if (clock_data->domain == self->priv->domain - && clock_data->last_ptp_time != 0) { + if (clock_data->domain == self->priv->domain && + clock_data->have_master_clock && clock_data->last_ptp_time != 0) { + GST_DEBUG ("Switching domain clock on domain %d", clock_data->domain); self->priv->domain_clock = clock_data->domain_clock; got_clock = TRUE; break; |