From: Thiago Santos Date: Thu, 7 Feb 2013 06:10:46 +0000 (-0300) Subject: mssdemux: add a maximum error count for downloads X-Git-Tag: 1.19.3~507^2~13691 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bf0ea5d5617ddf65e306f67490f9d84908459a86;p=platform%2Fupstream%2Fgstreamer.git mssdemux: add a maximum error count for downloads mssdemux will tolerate a few download errors before emitting an error message to the bus --- diff --git a/ext/smoothstreaming/gstmssdemux.c b/ext/smoothstreaming/gstmssdemux.c index 8127a4db93..0b4e6229c4 100644 --- a/ext/smoothstreaming/gstmssdemux.c +++ b/ext/smoothstreaming/gstmssdemux.c @@ -84,6 +84,7 @@ GST_DEBUG_CATEGORY (mssdemux_debug); #define DEFAULT_BITRATE_LIMIT 0.8 #define DOWNLOAD_RATE_MAX_HISTORY_LENGTH 5 +#define MAX_DOWNLOAD_ERROR_COUNT 3 enum { @@ -1223,6 +1224,8 @@ gst_mss_demux_download_loop (GstMssDemuxStream * stream) break; } + stream->download_error_count = 0; + if (buffer) { gst_mss_stream_advance_fragment (stream->manifest_stream); } @@ -1241,7 +1244,11 @@ eos: error: { GST_WARNING_OBJECT (mssdemux, "Error while pushing fragment"); - gst_task_pause (stream->download_task); + if (++stream->download_error_count >= DOWNLOAD_RATE_MAX_HISTORY_LENGTH) { + GST_ELEMENT_ERROR (mssdemux, RESOURCE, NOT_FOUND, + (_("Couldn't download fragments")), + ("fragment downloading has failed too much consecutive times")); + } return; } } diff --git a/ext/smoothstreaming/gstmssdemux.h b/ext/smoothstreaming/gstmssdemux.h index 2c48aac364..5e4f18502c 100644 --- a/ext/smoothstreaming/gstmssdemux.h +++ b/ext/smoothstreaming/gstmssdemux.h @@ -74,6 +74,8 @@ struct _GstMssDemuxStream { gboolean have_data; GstDownloadRate download_rate; + + guint download_error_count; }; struct _GstMssDemux {