[Bug 678429] Soup HTTP Src plugin - gst_soup_http_src_create does not return GST_FLOW_ERROR in case of HTTP error 404 not found
GStreamer (bugzilla.gnome.org)
bugzilla at gnome.org
Wed Jun 20 13:16:11 PDT 2012
https://bugzilla.gnome.org/show_bug.cgi?id=678429
GStreamer | gst-plugins-good | 0.10.16
--- Comment #2 from Norbert <nwaschbu at opentv.com> 2012-06-20 20:16:04 UTC ---
Hi Tim-Philipp,
Thanks for your comment. I am seeing the same problem with the 0.10.31 version
of gstsouphttpsrc.c.
In addition, I would like to add a minor revision to my observations:
=====================================================================
I've noticed that it is NOT the subsequent gst_soup_http_src_chunk_allocator
call that overwrites the error value GST_FLOW_ERROR of src->ret. The
gst_soup_http_src_got_chunk_cb does.
Revised paragraph for "What has been observed:"
===============================================
gst_soup_http_src_create initializes src->ret to GST_FLOW_CUSTOM_ERROR
(GstSoupHTTPSrc element instance structure) and then pends on src->ret to
change to a different error value. This is at least my understanding of this
part of the code. While gst_soup_src_create is pending, the following
callbacks are being observed: a) gst_soup_http_src_got_headers_cb and b)
gst_soup_http_src_got_chunk_cb.
The gst_soup_http_src_got_headers_cb calls gst_soup_http_src_parse_status.
gst_soup_http_src_parse_status detects an HTTP error and calls
GST_ELEMENT_ERROR. In addition, gst_soup_http_src_parse_status assigns
GST_FLOW_ERROR to src->ret. IMHO, a subsequent call to
gst_soup_http_src_got_chunk_cb appears to overwrite the error status by
assigning GST_FLOW_OK to src->ret. As a consequence, the pending
gst_soup_http_src_create returns a GST_FLOW_OK instead of GST_FLOW_ERROR as
expected. The gstreamer app receives a gst error message 404 Not Found, but I
don't see an Internal Data Flow Error triggered inline.
Behavior seen with file src:
============================
When setting an invalid "location" property (pathname does not match with any
files on the drive), I see an Internal Data Flow error. This would be next to
a gst error message of "Resource Not Found".
Experiment2:
============
An additional experiment was run in an attempt to avoid that the error value of
src->ret gets overwritten. The experimental code under "Experiment2:" was
added instead of the one listed under "Experiment:".
static void
gst_soup_http_src_got_chunk_cb (SoupMessage * msg, SoupBuffer * chunk,
GstSoupHTTPSrc * src)
{
...
new_position = src->read_position + chunk->length;
if (G_LIKELY (src->request_position == src->read_position))
src->request_position = new_position;
src->read_position = new_position;
/* START OF EXPERIMENTAL CODE */
if (src->ret == GST_FLOW_CUSTOM_ERROR )
{
src->ret = GST_FLOW_OK;
}
/* END OF EXPERIMENTAL CODE */
g_main_loop_quit (src->loop);
gst_soup_http_src_session_pause_message (src);
}
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the gstreamer-bugs
mailing list