Commit d48bd58e authored by Olivier Crête's avatar Olivier Crête

component: Use non-GClosure dummy callbacks

GClosures are not that cheap to setup
parent d44aa74e
......@@ -125,6 +125,18 @@ socket_source_free (SocketSource *source)
g_slice_free (SocketSource, source);
}
static gboolean
dummy_callback (gpointer data)
{
return G_SOURCE_CONTINUE;
}
static void
source_set_dummy_callback (GSource *source)
{
g_source_set_callback (source, dummy_callback, NULL, NULL);
}
Component *
component_new (guint id, NiceAgent *agent, Stream *stream)
{
......@@ -151,7 +163,7 @@ component_new (guint id, NiceAgent *agent, Stream *stream)
component->stop_cancellable = g_cancellable_new ();
component->stop_cancellable_source =
g_cancellable_source_new (component->stop_cancellable);
g_source_set_dummy_callback (component->stop_cancellable_source);
source_set_dummy_callback (component->stop_cancellable_source);
g_source_attach (component->stop_cancellable_source, component->own_ctx);
component->ctx = g_main_context_ref (component->own_ctx);
......@@ -1067,7 +1079,7 @@ component_source_prepare (GSource *source, gint *timeout_)
child_socket_source->source =
g_socket_create_source (child_socket_source->socket->fileno,
component_source->condition, NULL);
g_source_set_dummy_callback (child_socket_source->source);
source_set_dummy_callback (child_socket_source->source);
g_source_add_child_source (source, child_socket_source->source);
g_source_unref (child_socket_source->source);
component_source->socket_sources =
......@@ -1241,7 +1253,7 @@ component_source_new (NiceAgent *agent, guint stream_id,
GSource *cancellable_source;
cancellable_source = g_cancellable_source_new (cancellable);
g_source_set_dummy_callback (cancellable_source);
source_set_dummy_callback (cancellable_source);
g_source_add_child_source ((GSource *) component_source,
cancellable_source);
g_source_unref (cancellable_source);
......
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