Commit d21c42a7 authored by Thomas Vander Stichele's avatar Thomas Vander Stichele
Browse files

multihandlesink: fix one bug in multisocketsink refactoring

parent c0242742
......@@ -855,6 +855,8 @@ restart:
next = g_list_next (clients);
mhclient->status = GST_CLIENT_STATUS_REMOVED;
/* the next call changes the list, which is why we iterate
* with a temporary next pointer */
gst_multi_fd_sink_remove_client_link (sink, clients);
}
gst_poll_restart (sink->fdset);
......
......@@ -782,7 +782,7 @@ done:
void
gst_multi_socket_sink_clear (GstMultiHandleSink * mhsink)
{
GList *clients;
GList *clients, *next;
guint32 cookie;
GstMultiSocketSink *sink = GST_MULTI_SOCKET_SINK (mhsink);
......@@ -791,7 +791,7 @@ gst_multi_socket_sink_clear (GstMultiHandleSink * mhsink)
CLIENTS_LOCK (sink);
restart:
cookie = sink->clients_cookie;
for (clients = sink->clients; clients; clients = clients->next) {
for (clients = sink->clients; clients; clients = next) {
GstMultiHandleClient *mhclient;
if (cookie != sink->clients_cookie) {
......@@ -800,7 +800,11 @@ restart:
}
mhclient = (GstMultiHandleClient *) clients->data;
next = g_list_next (clients);
mhclient->status = GST_CLIENT_STATUS_REMOVED;
/* the next call changes the list, which is why we iterate
* with a temporary next pointer */
gst_multi_socket_sink_remove_client_link (sink, clients);
}
......
......@@ -587,9 +587,7 @@ GST_START_TEST (test_burst_client_bytes)
ASSERT_SET_STATE (sink, GST_STATE_NULL, GST_STATE_CHANGE_SUCCESS);
cleanup_multisocketsink (sink);
// FIXME for slomo: the refcount is now 3 instead of 1 ?
// ASSERT_CAPS_REFCOUNT (caps, "caps", 1);
ASSERT_CAPS_REFCOUNT (caps, "caps", 3);
ASSERT_CAPS_REFCOUNT (caps, "caps", 1);
gst_caps_unref (caps);
}
......@@ -690,9 +688,7 @@ GST_START_TEST (test_burst_client_bytes_keyframe)
ASSERT_SET_STATE (sink, GST_STATE_NULL, GST_STATE_CHANGE_SUCCESS);
cleanup_multisocketsink (sink);
// FIXME for slomo: the refcount is now 3 instead of 1 ?
// ASSERT_CAPS_REFCOUNT (caps, "caps", 1);
ASSERT_CAPS_REFCOUNT (caps, "caps", 3);
ASSERT_CAPS_REFCOUNT (caps, "caps", 1);
gst_caps_unref (caps);
}
......@@ -798,9 +794,7 @@ GST_START_TEST (test_burst_client_bytes_with_keyframe)
ASSERT_SET_STATE (sink, GST_STATE_NULL, GST_STATE_CHANGE_SUCCESS);
cleanup_multisocketsink (sink);
// FIXME for slomo: the refcount is now 3 instead of 1 ?
// ASSERT_CAPS_REFCOUNT (caps, "caps", 1);
ASSERT_CAPS_REFCOUNT (caps, "caps", 3);
ASSERT_CAPS_REFCOUNT (caps, "caps", 1);
gst_caps_unref (caps);
}
......
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