return FALSE;
}
-static gboolean
-gst_soup_http_src_is_seekable (GstBaseSrc * bsrc)
+static void
+gst_soup_http_src_check_seekable (GstSoupHTTPSrc * src)
{
- GstSoupHTTPSrc *src = GST_SOUP_HTTP_SRC (bsrc);
GstFlowReturn ret = GST_FLOW_OK;
/* Special case to check if the server allows range requests
* before really starting to get data in the buffer creation
* loops.
*/
- if (!src->got_headers && GST_STATE (src) != GST_STATE_NULL) {
+ if (!src->got_headers && GST_STATE (src) >= GST_STATE_PAUSED) {
g_mutex_lock (&src->mutex);
while (!src->got_headers && !src->interrupted && ret == GST_FLOW_OK) {
if ((src->msg && src->msg->method != SOUP_METHOD_HEAD) &&
g_mutex_unlock (&src->mutex);
}
+}
+
+static gboolean
+gst_soup_http_src_is_seekable (GstBaseSrc * bsrc)
+{
+ GstSoupHTTPSrc *src = GST_SOUP_HTTP_SRC (bsrc);
+
+ gst_soup_http_src_check_seekable (src);
+
return src->seekable;
}
return TRUE;
}
- if (!src->seekable) {
+ gst_soup_http_src_check_seekable (src);
+
+ /* If we have no headers we don't know yet if it is seekable or not.
+ * Store the start position and error out later if it isn't */
+ if (src->got_headers && !src->seekable) {
GST_WARNING_OBJECT (src, "Not seekable");
return FALSE;
}