mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 15:08:53 +00:00
multiudpsink: fix client count after removal
This commit is contained in:
parent
7bdf7500a1
commit
fa3ef2e54c
1 changed files with 12 additions and 1 deletions
|
@ -1734,6 +1734,7 @@ gst_multiudpsink_add (GstMultiUDPSink * sink, const gchar * host, gint port)
|
||||||
void
|
void
|
||||||
gst_multiudpsink_remove (GstMultiUDPSink * sink, const gchar * host, gint port)
|
gst_multiudpsink_remove (GstMultiUDPSink * sink, const gchar * host, gint port)
|
||||||
{
|
{
|
||||||
|
GSocketFamily family;
|
||||||
GList *find;
|
GList *find;
|
||||||
GstUDPClient udpclient;
|
GstUDPClient udpclient;
|
||||||
GstUDPClient *client;
|
GstUDPClient *client;
|
||||||
|
@ -1755,9 +1756,14 @@ gst_multiudpsink_remove (GstMultiUDPSink * sink, const gchar * host, gint port)
|
||||||
|
|
||||||
--client->add_count;
|
--client->add_count;
|
||||||
|
|
||||||
|
family = g_socket_address_get_family (client->addr);
|
||||||
|
if (family == G_SOCKET_FAMILY_IPV4)
|
||||||
|
--sink->num_v4_all;
|
||||||
|
else
|
||||||
|
--sink->num_v6_all;
|
||||||
|
|
||||||
if (client->add_count == 0) {
|
if (client->add_count == 0) {
|
||||||
GInetSocketAddress *saddr = G_INET_SOCKET_ADDRESS (client->addr);
|
GInetSocketAddress *saddr = G_INET_SOCKET_ADDRESS (client->addr);
|
||||||
GSocketFamily family = g_socket_address_get_family (client->addr);
|
|
||||||
GInetAddress *addr = g_inet_socket_address_get_address (saddr);
|
GInetAddress *addr = g_inet_socket_address_get_address (saddr);
|
||||||
GSocket *socket;
|
GSocket *socket;
|
||||||
|
|
||||||
|
@ -1784,6 +1790,11 @@ gst_multiudpsink_remove (GstMultiUDPSink * sink, const gchar * host, gint port)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (family == G_SOCKET_FAMILY_IPV4)
|
||||||
|
--sink->num_v4_unique;
|
||||||
|
else
|
||||||
|
--sink->num_v6_unique;
|
||||||
|
|
||||||
/* Unlock to emit signal before we delete the actual client */
|
/* Unlock to emit signal before we delete the actual client */
|
||||||
g_mutex_unlock (&sink->client_lock);
|
g_mutex_unlock (&sink->client_lock);
|
||||||
g_signal_emit (G_OBJECT (sink),
|
g_signal_emit (G_OBJECT (sink),
|
||||||
|
|
Loading…
Reference in a new issue