From: Andy Wingo Date: Thu, 24 Nov 2005 18:09:09 +0000 (+0000) Subject: gst/tcp/gstmultifdsink.c (gst_multifdsink_handle_client_write): Be threadsafe. X-Git-Tag: 1.19.3~511^2~12462 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=55d3769623703ca3e1fe64688599aa61b467f605;p=platform%2Fupstream%2Fgstreamer.git gst/tcp/gstmultifdsink.c (gst_multifdsink_handle_client_write): Be threadsafe. Original commit message from CVS: 2005-11-24 Andy Wingo * gst/tcp/gstmultifdsink.c (gst_multifdsink_handle_client_write): Be threadsafe. --- diff --git a/ChangeLog b/ChangeLog index 229a77f..9025990 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-11-24 Andy Wingo + + * gst/tcp/gstmultifdsink.c (gst_multifdsink_handle_client_write): + Be threadsafe. + 2005-11-23 Thomas Vander Stichele * configure.ac: back to HEAD diff --git a/common b/common index ea14091..1b24580 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit ea1409191cc1e71273b2dbdd94e7ab5fc5a60a51 +Subproject commit 1b24580b06e738f920b33ea68dffd83d953f0bba diff --git a/gst/tcp/gstmultifdsink.c b/gst/tcp/gstmultifdsink.c index 40d08eb..2830905 100644 --- a/gst/tcp/gstmultifdsink.c +++ b/gst/tcp/gstmultifdsink.c @@ -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;