diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2015-06-05 11:26:11 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-06-05 11:26:11 +0200 |
commit | 4dd355cea251987ad37eb53c65292e735a73110b (patch) | |
tree | f1c18d3379f9dd374840a029c92fc7b6a7d2b8e5 /gst-libs/gst/adaptivedemux | |
parent | adcf3f48a51499826777b44b6ed5c1d269fcd278 (diff) | |
download | gstreamer-plugins-bad-4dd355cea251987ad37eb53c65292e735a73110b.tar.gz |
adaptivedemux: Error out if downloading a segment failed too often in live mode
It's true that we shouldn't consider errors fatal immediately, but if we
always ignore them we will loop infinitely on live streams with segments
that can't be downloaded at all.
Diffstat (limited to 'gst-libs/gst/adaptivedemux')
-rw-r--r-- | gst-libs/gst/adaptivedemux/gstadaptivedemux.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c index 6286273bd..854aefc58 100644 --- a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c +++ b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c @@ -1896,9 +1896,11 @@ gst_adaptive_demux_stream_download_fragment (GstAdaptiveDemuxStream * stream) if (ret != GST_FLOW_OK) { /* TODO check if we are truly stoping */ if (ret != GST_FLOW_ERROR && gst_adaptive_demux_is_live (demux)) { - /* looks like there is no way of knowing when a live stream has ended - * Have to assume we are falling behind and cause a manifest reload */ - return GST_FLOW_EOS; + if (++stream->download_error_count <= MAX_DOWNLOAD_ERROR_COUNT) { + /* looks like there is no way of knowing when a live stream has ended + * Have to assume we are falling behind and cause a manifest reload */ + return GST_FLOW_EOS; + } } } } |