mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-27 00:16:37 +00:00
audiodecoder: Allow using -1 for infinite tolerated errors
Allows using -1 to make audiodecoder never post an error message after decoding errors. Based on the videodecoder change, merged here for consistency. https://bugzilla.gnome.org/show_bug.cgi?id=711094
This commit is contained in:
parent
0e9806a03e
commit
b0788ce054
1 changed files with 7 additions and 5 deletions
|
@ -2523,9 +2523,10 @@ _gst_audio_decoder_error (GstAudioDecoder * dec, gint weight,
|
||||||
GST_WARNING_OBJECT (dec, "error: %s", dbg);
|
GST_WARNING_OBJECT (dec, "error: %s", dbg);
|
||||||
dec->priv->error_count += weight;
|
dec->priv->error_count += weight;
|
||||||
dec->priv->discont = TRUE;
|
dec->priv->discont = TRUE;
|
||||||
if (dec->priv->ctx.max_errors < dec->priv->error_count) {
|
if (dec->priv->ctx.max_errors >= 0
|
||||||
gst_element_message_full (GST_ELEMENT (dec), GST_MESSAGE_ERROR,
|
&& dec->priv->ctx.max_errors < dec->priv->error_count) {
|
||||||
domain, code, txt, dbg, file, function, line);
|
gst_element_message_full (GST_ELEMENT (dec), GST_MESSAGE_ERROR, domain,
|
||||||
|
code, txt, dbg, file, function, line);
|
||||||
return GST_FLOW_ERROR;
|
return GST_FLOW_ERROR;
|
||||||
} else {
|
} else {
|
||||||
g_free (txt);
|
g_free (txt);
|
||||||
|
@ -2626,8 +2627,9 @@ gst_audio_decoder_get_delay (GstAudioDecoder * dec)
|
||||||
* @num: max tolerated errors
|
* @num: max tolerated errors
|
||||||
*
|
*
|
||||||
* Sets numbers of tolerated decoder errors, where a tolerated one is then only
|
* 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
|
* warned about, but more than tolerated will lead to fatal error. You can set
|
||||||
* is set to GST_AUDIO_DECODER_MAX_ERRORS.
|
* -1 for never returning fatal errors. Default is set to
|
||||||
|
* GST_AUDIO_DECODER_MAX_ERRORS.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
gst_audio_decoder_set_max_errors (GstAudioDecoder * dec, gint num)
|
gst_audio_decoder_set_max_errors (GstAudioDecoder * dec, gint num)
|
||||||
|
|
Loading…
Reference in a new issue