Commit 24815a5f authored by Thiago Santos's avatar Thiago Santos

dashdemux: return the error to the source immediately to stop faster

When flushing, this will prevent dashdemux from trying to download more
fragments or more chunks of the same fragment before stopping.

Also improves the error handling to not transform everything non-ok into
an error.

https://bugzilla.gnome.org/show_bug.cgi?id=734014
parent 1685c454
......@@ -1974,11 +1974,10 @@ _src_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
/* TODO properly stop tasks */
/* gst_hls_demux_pause_tasks (demux); */
g_cond_signal (&stream->fragment_download_cond);
}
/* avoid having the source handle the same error again */
stream->last_ret = ret;
ret = GST_FLOW_OK;
return ret;
}
......@@ -2317,7 +2316,6 @@ static GstFlowReturn
gst_dash_demux_stream_get_next_fragment (GstDashDemuxStream * stream,
GstClockTime * ts)
{
GstFlowReturn ret = GST_FLOW_OK;
GstDashDemux *demux = stream->demux;
if (stream->stream_eos)
......@@ -2358,11 +2356,11 @@ gst_dash_demux_stream_get_next_fragment (GstDashDemuxStream * stream,
demux->end_of_period = FALSE;
if (stream->last_ret < GST_FLOW_EOS) {
GST_WARNING_OBJECT (stream->pad, "Failed to download fragment");
return GST_FLOW_ERROR;
if (stream->last_ret != GST_FLOW_OK) {
GST_WARNING_OBJECT (stream->pad, "Failed to download fragment: %s",
gst_flow_get_name (stream->last_ret));
}
return ret;
return stream->last_ret;
}
static void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment