From 15952dcd8e4589ace1c763a6b7b6b5430ce8e96c Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Thu, 1 May 2014 21:04:54 -0300 Subject: [PATCH] dashdemux: check for errors between downloads To abort earlier in case of failures --- ext/dash/gstdashdemux.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ext/dash/gstdashdemux.c b/ext/dash/gstdashdemux.c index ad21b39872..63508a1364 100644 --- a/ext/dash/gstdashdemux.c +++ b/ext/dash/gstdashdemux.c @@ -2170,12 +2170,23 @@ gst_dash_demux_stream_download_fragment (GstDashDemux * demux, GST_TIME_ARGS (fragment->duration), fragment->range_start, fragment->range_end); + /* Reset last flow return */ + stream->last_ret = GST_FLOW_OK; + if (stream->need_header) { /* We need to fetch a new header */ gst_dash_demux_get_next_header (demux, stream); stream->need_header = FALSE; } + if (stream->last_ret != GST_FLOW_OK) { + GST_WARNING_OBJECT (stream->pad, "Failed to download headers"); + goto exit; + } + + if (demux->cancelled) + goto exit; + /* it is possible to have an index per fragment, so check and download */ if (fragment->index_uri || fragment->index_range_start || fragment->index_range_end != -1) { @@ -2192,6 +2203,11 @@ gst_dash_demux_stream_download_fragment (GstDashDemux * demux, fragment->index_range_start, fragment->index_range_end); } + if (stream->last_ret != GST_FLOW_OK) { + GST_WARNING_OBJECT (stream->pad, "Failed to download fragment headers"); + goto exit; + } + if (demux->cancelled) goto exit;