mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
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.
This commit is contained in:
parent
16dde2f9a3
commit
5cfaf19e95
1 changed files with 13 additions and 9 deletions
|
@ -559,13 +559,16 @@ soup_got_headers (SoupMessage * msg, GstSouphttpSrc * src)
|
||||||
const char *value;
|
const char *value;
|
||||||
GstTagList *tag_list;
|
GstTagList *tag_list;
|
||||||
GstBaseSrc *basesrc;
|
GstBaseSrc *basesrc;
|
||||||
|
guint64 newsize;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (src, "got headers");
|
GST_DEBUG_OBJECT (src, "got headers");
|
||||||
|
|
||||||
/* Parse Content-Length. */
|
/* Parse Content-Length. */
|
||||||
value = soup_message_get_header (msg->response_headers, "Content-Length");
|
value = soup_message_get_header (msg->response_headers, "Content-Length");
|
||||||
if (value != NULL) {
|
if (value != NULL) {
|
||||||
src->content_size = g_ascii_strtoull (value, NULL, 10);
|
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;
|
src->have_size = TRUE;
|
||||||
GST_DEBUG_OBJECT (src, "size = %llu", src->content_size);
|
GST_DEBUG_OBJECT (src, "size = %llu", src->content_size);
|
||||||
|
|
||||||
|
@ -576,6 +579,7 @@ soup_got_headers (SoupMessage * msg, GstSouphttpSrc * src)
|
||||||
gst_message_new_duration (GST_OBJECT (src), GST_FORMAT_BYTES,
|
gst_message_new_duration (GST_OBJECT (src), GST_FORMAT_BYTES,
|
||||||
src->content_size));
|
src->content_size));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Icecast stuff */
|
/* Icecast stuff */
|
||||||
tag_list = gst_tag_list_new ();
|
tag_list = gst_tag_list_new ();
|
||||||
|
|
Loading…
Reference in a new issue