diff options
author | Wouter Cloetens <wouter@mind.be> | 2008-01-20 05:07:52 +0000 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2008-01-20 05:07:52 +0000 |
commit | e1e93d1510fb802851bfcd43c2ed4f04a3c6bffe (patch) | |
tree | b36e2d5df77446cfea398417a3e6f5d396f050d8 /ext/soup | |
parent | 252d4044bf20602c2489243c5f554df9b992d7c4 (diff) | |
download | gst-plugins-bad-e1e93d1510fb802851bfcd43c2ed4f04a3c6bffe.tar.gz gst-plugins-bad-e1e93d1510fb802851bfcd43c2ed4f04a3c6bffe.tar.bz2 gst-plugins-bad-e1e93d1510fb802851bfcd43c2ed4f04a3c6bffe.zip |
ext/soup/gstsouphttpsrc.c: Report the size of the stream as the total size instead of the remaining Content-Length, w...
Original commit message from CVS:
Patch by: Wouter Cloetens <wouter at mind dot be>
* ext/soup/gstsouphttpsrc.c: (soup_got_headers):
Report the size of the stream as the total size instead of
the remaining Content-Length, which is wrong after a seek.
Diffstat (limited to 'ext/soup')
-rw-r--r-- | ext/soup/gstsouphttpsrc.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/ext/soup/gstsouphttpsrc.c b/ext/soup/gstsouphttpsrc.c index e3127e47..8e850519 100644 --- a/ext/soup/gstsouphttpsrc.c +++ b/ext/soup/gstsouphttpsrc.c @@ -559,22 +559,26 @@ soup_got_headers (SoupMessage * msg, GstSouphttpSrc * src) const char *value; GstTagList *tag_list; GstBaseSrc *basesrc; + guint64 newsize; GST_DEBUG_OBJECT (src, "got headers"); /* Parse Content-Length. */ value = soup_message_get_header (msg->response_headers, "Content-Length"); if (value != NULL) { - src->content_size = g_ascii_strtoull (value, NULL, 10); - src->have_size = TRUE; - GST_DEBUG_OBJECT (src, "size = %llu", src->content_size); - - basesrc = GST_BASE_SRC_CAST (src); - gst_segment_set_duration (&basesrc->segment, GST_FORMAT_BYTES, - src->content_size); - gst_element_post_message (GST_ELEMENT (src), - gst_message_new_duration (GST_OBJECT (src), GST_FORMAT_BYTES, - src->content_size)); + newsize = src->request_position + g_ascii_strtoull (value, NULL, 10); + if (!src->have_size || (src->content_size != newsize)) { + src->content_size = newsize; + src->have_size = TRUE; + GST_DEBUG_OBJECT (src, "size = %llu", src->content_size); + + basesrc = GST_BASE_SRC_CAST (src); + gst_segment_set_duration (&basesrc->segment, GST_FORMAT_BYTES, + src->content_size); + gst_element_post_message (GST_ELEMENT (src), + gst_message_new_duration (GST_OBJECT (src), GST_FORMAT_BYTES, + src->content_size)); + } } /* Icecast stuff */ |