From 954064a8d61d0fca26542d4caab7cdb9a3a5f79e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 11 Mar 2010 15:24:20 +0000 Subject: [PATCH] souphttpsrc: fix metadata writable warnings Set metadata on buffer first, when the refcount is still 1, and only ref again afterwards. --- ext/soup/gstsouphttpsrc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/soup/gstsouphttpsrc.c b/ext/soup/gstsouphttpsrc.c index c50fd3e84e..f182ec9aa6 100644 --- a/ext/soup/gstsouphttpsrc.c +++ b/ext/soup/gstsouphttpsrc.c @@ -1004,7 +1004,7 @@ gst_soup_http_src_got_chunk_cb (SoupMessage * msg, SoupBuffer * chunk, /* Extract the GstBuffer from the SoupBuffer and set its fields. */ *src->outbuf = GST_BUFFER_CAST (soup_buffer_get_owner (chunk)); - gst_buffer_ref (*src->outbuf); + GST_BUFFER_SIZE (*src->outbuf) = chunk->length; GST_BUFFER_OFFSET (*src->outbuf) = basesrc->segment.last_stop; @@ -1012,6 +1012,8 @@ gst_soup_http_src_got_chunk_cb (SoupMessage * msg, SoupBuffer * chunk, (src->src_caps) ? src->src_caps : GST_PAD_CAPS (GST_BASE_SRC_PAD (basesrc))); + gst_buffer_ref (*src->outbuf); + new_position = src->read_position + chunk->length; if (G_LIKELY (src->request_position == src->read_position)) src->request_position = new_position;