diff options
author | Jan Schmidt <jan@centricular.com> | 2018-10-11 14:34:40 +1100 |
---|---|---|
committer | Jan Schmidt <jan@centricular.com> | 2018-10-11 22:11:51 +1100 |
commit | 04176bede1ecca332bf8ac8608a12cd835f6a818 (patch) | |
tree | e011d435131a4003ba682af9e8ba48bfb1ba4161 | |
parent | d37fcea225452cb334d28e4c93b01e734574ff0f (diff) | |
download | gstreamer-04176bede1ecca332bf8ac8608a12cd835f6a818.tar.gz |
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 2db4175558..c2d09152c2 100644 --- a/libs/gst/net/gstptpclock.c +++ b/libs/gst/net/gstptpclock.c @@ -2405,8 +2405,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; |