From 92b43c3e0a59351637f57682384a9a05a2d8ced6 Mon Sep 17 00:00:00 2001 From: "Joshua M. Doe" Date: Wed, 26 May 2021 10:38:38 -0400 Subject: [PATCH] gentlsrc: if GEV timestamp latch fails use previous value This has been encountered with multiple instances using the same producer --- sys/gentl/gstgentlsrc.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sys/gentl/gstgentlsrc.c b/sys/gentl/gstgentlsrc.c index 8b1a189..3f5ce4c 100644 --- a/sys/gentl/gstgentlsrc.c +++ b/sys/gentl/gstgentlsrc.c @@ -886,8 +886,17 @@ error: static void gst_gentlsrc_src_latch_timestamps (GstGenTlSrc * src) { - src->unix_latched_time = get_unix_ns (); - src->gentl_latched_ticks = gst_gentlsrc_get_gev_timestamp_ticks (src); + guint64 unix_ts, gev_ts; + + unix_ts = get_unix_ns (); + gev_ts = gst_gentlsrc_get_gev_timestamp_ticks (src); + + if (gev_ts != 0) { + src->unix_latched_time = unix_ts; + src->gentl_latched_ticks = gev_ts; + } else { + GST_WARNING_OBJECT (src, "Failed to latch GEV time, using old latch value"); + } } static gboolean