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;
* @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)