adaptivedemux: Explicitly check for CUSTOM_ERROR when converting errors to EOS
authorSebastian Dröge <sebastian@centricular.com>
Tue, 7 Jul 2015 16:48:23 +0000 (19:48 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 7 Jul 2015 16:51:39 +0000 (19:51 +0300)
We use things like CUSTOM_SUCCESS* in other places, and those are not errors
but should just be handled like OK.

gst-libs/gst/adaptivedemux/gstadaptivedemux.c

index b2acf33c394670aaeb6521691aaa42f7138c06c8..7df1c63596ee0ccc6302c04efed5d1b671104797 100644 (file)
@@ -1931,7 +1931,7 @@ gst_adaptive_demux_stream_download_fragment (GstAdaptiveDemuxStream * stream)
         stream->last_ret, gst_flow_get_name (stream->last_ret));
     if (ret != GST_FLOW_OK) {
       /* TODO check if we are truly stoping */
-      if (ret != GST_FLOW_ERROR && gst_adaptive_demux_is_live (demux)) {
+      if (ret == GST_FLOW_CUSTOM_ERROR && gst_adaptive_demux_is_live (demux)) {
         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 */
@@ -1939,7 +1939,7 @@ gst_adaptive_demux_stream_download_fragment (GstAdaptiveDemuxStream * stream)
               "Converting error of live stream to EOS");
           return GST_FLOW_EOS;
         }
-      } else if (ret != GST_FLOW_ERROR
+      } else if (ret == GST_FLOW_CUSTOM_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