When receiving an error code from the http server, such as 404,
data might be sent along with it, like a web page. We don't want
to output that data in this case, and we also want to pass the
FLOW_ERROR return back to the base class, so it can stop properly.
https://bugzilla.gnome.org/show_bug.cgi?id=678429
("Server does not accept Range HTTP header, URL: %s", src->location));
src->ret = GST_FLOW_ERROR;
}
+
+ /* If we are going to error out, stop all processing right here, so we
+ * don't output any data (such as an error html page), and return
+ * GST_FLOW_ERROR from the create function instead of having
+ * got_chunk_cb overwrite src->ret with FLOW_OK again. */
+ if (src->ret == GST_FLOW_ERROR) {
+ gst_soup_http_src_session_pause_message (src);
+
+ if (src->loop)
+ g_main_loop_quit (src->loop);
+ }
}
/* Have body. Signal EOS. */