From: Thiago Santos Date: Tue, 29 Oct 2013 17:11:51 +0000 (-0300) Subject: videodecoder: allow using -1 for infinite tolerated errors X-Git-Tag: 1.3.1~360 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0765962fbc963ea9c2c506b4d5b50a80cdcdae5e;p=platform%2Fupstream%2Fgst-plugins-base.git videodecoder: allow using -1 for infinite tolerated errors Allows using -1 to make videodecoder never post an error message after decoding errors. https://bugzilla.gnome.org/show_bug.cgi?id=711094 --- diff --git a/gst-libs/gst/video/gstvideodecoder.c b/gst-libs/gst/video/gstvideodecoder.c index 4e69a76..a1a6ed6 100644 --- a/gst-libs/gst/video/gstvideodecoder.c +++ b/gst-libs/gst/video/gstvideodecoder.c @@ -3372,7 +3372,8 @@ _gst_video_decoder_error (GstVideoDecoder * dec, gint weight, GST_WARNING_OBJECT (dec, "error: %s", dbg); dec->priv->error_count += weight; dec->priv->discont = TRUE; - if (dec->priv->max_errors < dec->priv->error_count) { + if (dec->priv->max_errors >= 0 && + dec->priv->error_count > dec->priv->max_errors) { gst_element_message_full (GST_ELEMENT (dec), GST_MESSAGE_ERROR, domain, code, txt, dbg, file, function, line); return GST_FLOW_ERROR; @@ -3389,8 +3390,11 @@ _gst_video_decoder_error (GstVideoDecoder * dec, gint weight, * @num: max tolerated errors * * Sets numbers of tolerated decoder errors, where a tolerated one is then only - * warned about, but more than tolerated will lead to fatal error. Default - * is set to GST_VIDEO_DECODER_MAX_ERRORS. + * warned about, but more than tolerated will lead to fatal error. You can set + * -1 for never returning fatal errors. Default is set to + * GST_VIDEO_DECODER_MAX_ERRORS. + * + * The '-1' option was added in 1.4 */ void gst_video_decoder_set_max_errors (GstVideoDecoder * dec, gint num)