diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2015-07-07 18:37:24 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-07-07 19:51:39 +0300 |
commit | a78c1bdad552914cb1c368cc2c5e3ba90889cdf6 (patch) | |
tree | 1edfb1959537eccbc501f16b2f05fb68c1d15e96 /gst-libs | |
parent | d5a39896dc888fad77f88c976d2939ca5522406d (diff) | |
download | gstreamer-plugins-bad-a78c1bdad552914cb1c368cc2c5e3ba90889cdf6.tar.gz |
adaptivedemux: If downloading the last fragment fails, consider this as EOS and not ERROR
Sometimes the last fragment does not exist because of rounding errors with the
durations. Just finish the stream gracefully instead of erroring out instead.
Diffstat (limited to 'gst-libs')
-rw-r--r-- | gst-libs/gst/adaptivedemux/gstadaptivedemux.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c index 6dffd818c..b2acf33c3 100644 --- a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c +++ b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c @@ -1935,8 +1935,18 @@ gst_adaptive_demux_stream_download_fragment (GstAdaptiveDemuxStream * stream) 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 */ + GST_DEBUG_OBJECT (stream->pad, + "Converting error of live stream to EOS"); return GST_FLOW_EOS; } + } else if (ret != GST_FLOW_ERROR + && !gst_adaptive_demux_stream_has_next_fragment (demux, stream)) { + /* If this is the last fragment, consider failures EOS and not actual + * errors. Due to rounding errors in the durations, the last fragment + * might not actually exist */ + GST_DEBUG_OBJECT (stream->pad, + "Converting error for last fragment to EOS"); + return GST_FLOW_EOS; } } } |