Commit 35f3529a authored by Julian Bouzas's avatar Julian Bouzas
Browse files

base-endpoint: update endpoint creation time when destroying a link

parent 14c9644f
Pipeline #88701 passed with stage
in 1 minute and 51 seconds
......@@ -126,6 +126,14 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (WpBaseEndpoint, wp_base_endpoint, G_TYPE_OBJEC
G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE,
wp_base_endpoint_async_initable_init))
static void
wp_base_endpoint_update_current_time (WpBaseEndpoint *self)
{
WpBaseEndpointPrivate *priv = wp_base_endpoint_get_instance_private (self);
priv->creation_time = (guint64) g_get_monotonic_time ();
}
static void
wp_base_endpoint_init_async (GAsyncInitable *initable, int io_priority,
GCancellable *cancellable, GAsyncReadyCallback callback, gpointer data)
......@@ -157,7 +165,8 @@ wp_base_endpoint_init (WpBaseEndpoint * self)
g_weak_ref_init (&priv->core, NULL);
priv->creation_time = (guint64) g_get_monotonic_time ();
wp_base_endpoint_update_current_time (self);
priv->streams =
g_ptr_array_new_with_free_func ((GDestroyNotify) g_variant_unref);
priv->controls =
......@@ -1125,9 +1134,11 @@ wp_base_endpoint_link_destroy (WpBaseEndpointLink * self)
if (src) {
endpoint_priv = wp_base_endpoint_get_instance_private (src);
g_ptr_array_remove_fast (endpoint_priv->links, self);
wp_base_endpoint_update_current_time (src);
}
if (sink) {
endpoint_priv = wp_base_endpoint_get_instance_private (sink);
g_ptr_array_remove_fast (endpoint_priv->links, self);
wp_base_endpoint_update_current_time (sink);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment