gst/tcp/gstmultifdsink.c (gst_multifdsink_handle_client_write): Be threadsafe.

Original commit message from CVS:
2005-11-24  Andy Wingo  <wingo@pobox.com>

* gst/tcp/gstmultifdsink.c (gst_multifdsink_handle_client_write):
Be threadsafe.
This commit is contained in:
Andy Wingo 2005-11-24 18:09:09 +00:00
parent 3831f3774e
commit 55d3769623
3 changed files with 24 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2005-11-24 Andy Wingo <wingo@pobox.com>
* gst/tcp/gstmultifdsink.c (gst_multifdsink_handle_client_write):
Be threadsafe.
2005-11-23 Thomas Vander Stichele <thomas at apestaart dot org>
* configure.ac: back to HEAD

2
common

@ -1 +1 @@
Subproject commit ea1409191cc1e71273b2dbdd94e7ab5fc5a60a51
Subproject commit 1b24580b06e738f920b33ea68dffd83d953f0bba

View file

@ -165,8 +165,8 @@ gst_sync_method_get_type (void)
{GST_SYNC_METHOD_NEXT_KEYFRAME,
"Serve starting from the next keyframe", "next-keyframe"},
{GST_SYNC_METHOD_LATEST_KEYFRAME,
"Serve everything since the latest keyframe (burst)",
"latest-keyframe"},
"Serve everything since the latest keyframe (burst)",
"latest-keyframe"},
{0, NULL, NULL},
};
@ -797,6 +797,8 @@ gst_multifdsink_client_queue_caps (GstMultiFdSink * sink, GstTCPClient * client,
guint length;
gchar *string;
g_return_val_if_fail (caps != NULL, FALSE);
string = gst_caps_to_string (caps);
GST_DEBUG_OBJECT (sink, "[fd %5d] Queueing caps %s through GDP",
client->fd.fd, string);
@ -974,11 +976,23 @@ gst_multifdsink_handle_client_write (GstMultiFdSink * sink,
/* when using GDP, first check if we have queued caps yet */
if (sink->protocol == GST_TCP_PROTOCOL_GDP) {
if (!client->caps_sent) {
const GstCaps *caps =
GST_PAD_CAPS (GST_PAD_PEER (GST_BASE_SINK_PAD (sink)));
GstPad *peer;
GstCaps *caps;
peer = gst_pad_get_peer (GST_BASE_SINK_PAD (sink));
if (!peer) {
GST_WARNING_OBJECT (sink, "pad has no peer");
return FALSE;
}
caps = gst_pad_get_negotiated_caps (peer);
gst_object_unref (peer);
/* queue caps for sending */
res = gst_multifdsink_client_queue_caps (sink, client, caps);
gst_caps_unref (caps);
if (!res) {
GST_DEBUG_OBJECT (sink, "Failed queueing caps, removing client");
return FALSE;