From 9d77bcfb2982d3f036ba1c5fdecebc0036d8909a Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Tue, 23 Mar 2010 19:30:50 +0100 Subject: [PATCH] souphttpsrc: Set the Content-Type HTTP header on the caps. First step to fixing ShoutCast (NSV) streaming. --- ext/soup/gstsouphttpsrc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ext/soup/gstsouphttpsrc.c b/ext/soup/gstsouphttpsrc.c index 902b3536d7..79268b27cd 100644 --- a/ext/soup/gstsouphttpsrc.c +++ b/ext/soup/gstsouphttpsrc.c @@ -774,7 +774,8 @@ gst_soup_http_src_got_headers_cb (SoupMessage * msg, GstSoupHTTPSrc * src) src->src_caps = gst_caps_new_simple ("application/x-icy", "metadata-interval", G_TYPE_INT, icy_metaint, NULL); } - } else if ((value = + } + if ((value = soup_message_headers_get_content_type (msg->response_headers, ¶ms)) != NULL) { GST_DEBUG_OBJECT (src, "Content-Type: %s", value); @@ -801,6 +802,11 @@ gst_soup_http_src_got_headers_cb (SoupMessage * msg, GstSoupHTTPSrc * src) "depth", G_TYPE_INT, 16, "signed", G_TYPE_BOOLEAN, TRUE, "endianness", G_TYPE_INT, G_BIG_ENDIAN, NULL); + } else { + /* Set the Content-Type field on the caps */ + if (src->src_caps) + gst_caps_set_simple (src->src_caps, "content-type", G_TYPE_STRING, + value, NULL); } }