From 4dfad42e8165cdba6a25add20ed141aec34bc210 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 13 Feb 2014 11:11:13 +0100 Subject: [PATCH] souphttpsrc: Consistently use have_size instead of content_size!=0 --- ext/soup/gstsouphttpsrc.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/ext/soup/gstsouphttpsrc.c b/ext/soup/gstsouphttpsrc.c index 9572a7b..a62b46a 100644 --- a/ext/soup/gstsouphttpsrc.c +++ b/ext/soup/gstsouphttpsrc.c @@ -114,7 +114,7 @@ enum #define DEFAULT_USER_AGENT "GStreamer souphttpsrc " #define DEFAULT_IRADIO_MODE TRUE -#define DEFAULT_SOUP_LOG_LEVEL SOUP_LOGGER_LOG_NONE +#define DEFAULT_SOUP_LOG_LEVEL SOUP_LOGGER_LOG_HEADERS #define DEFAULT_COMPRESS FALSE #define DEFAULT_KEEP_ALIVE FALSE @@ -1181,14 +1181,18 @@ gst_soup_http_src_got_chunk_cb (SoupMessage * msg, SoupBuffer * chunk, src->request_position = new_position; src->read_position = new_position; - if (src->content_size != 0 && new_position > src->content_size) { - GST_DEBUG_OBJECT (src, "Got position previous estimated content size " - "(%" G_GINT64_FORMAT " > %" G_GINT64_FORMAT ")", new_position, - src->content_size); - src->content_size = new_position; - basesrc->segment.duration = src->content_size; - gst_element_post_message (GST_ELEMENT (src), - gst_message_new_duration_changed (GST_OBJECT (src))); + if (src->have_size) { + if (new_position > src->content_size) { + GST_DEBUG_OBJECT (src, "Got position previous estimated content size " + "(%" G_GINT64_FORMAT " > %" G_GINT64_FORMAT ")", new_position, + src->content_size); + src->content_size = new_position; + basesrc->segment.duration = src->content_size; + gst_element_post_message (GST_ELEMENT (src), + gst_message_new_duration_changed (GST_OBJECT (src))); + } else if (new_position == src->content_size) { + GST_DEBUG_OBJECT (src, "We're EOS now"); + } } src->ret = GST_FLOW_OK; @@ -1607,7 +1611,7 @@ gst_soup_http_src_do_seek (GstBaseSrc * bsrc, GstSegment * segment) return FALSE; } - if (src->content_size != 0 && segment->start >= src->content_size) { + if (src->have_size && segment->start >= src->content_size) { GST_WARNING_OBJECT (src, "Potentially seeking behind end of file, might EOS immediately"); } -- 2.7.4