mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
opus: Post error message on GST_FLOW_ERROR
https://bugzilla.gnome.org/show_bug.cgi?id=766265
This commit is contained in:
parent
1a700c3ae6
commit
0bfed26f56
2 changed files with 13 additions and 8 deletions
|
@ -316,7 +316,8 @@ gst_opus_dec_parse_header (GstOpusDec * dec, GstBuffer * buf)
|
|||
const GstAudioChannelPosition *posn = NULL;
|
||||
|
||||
if (!gst_opus_header_is_id_header (buf)) {
|
||||
GST_ERROR_OBJECT (dec, "Header is not an Opus ID header");
|
||||
GST_ELEMENT_ERROR (dec, STREAM, FORMAT, ("Header is not an Opus ID header"),
|
||||
(NULL));
|
||||
return GST_FLOW_ERROR;
|
||||
}
|
||||
|
||||
|
@ -327,7 +328,8 @@ gst_opus_dec_parse_header (GstOpusDec * dec, GstBuffer * buf)
|
|||
&dec->n_streams,
|
||||
&dec->n_stereo_streams,
|
||||
dec->channel_mapping, &dec->pre_skip, &dec->r128_gain)) {
|
||||
GST_ERROR_OBJECT (dec, "Failed to parse Opus ID header");
|
||||
GST_ELEMENT_ERROR (dec, STREAM, DECODE, ("Failed to parse Opus ID header"),
|
||||
(NULL));
|
||||
return GST_FLOW_ERROR;
|
||||
}
|
||||
dec->r128_gain_volume = gst_opus_dec_get_r128_volume (dec->r128_gain);
|
||||
|
@ -646,11 +648,13 @@ done:
|
|||
return res;
|
||||
|
||||
creation_failed:
|
||||
GST_ERROR_OBJECT (dec, "Failed to create Opus decoder: %d", err);
|
||||
GST_ELEMENT_ERROR (dec, LIBRARY, INIT, ("Failed to create Opus decoder"),
|
||||
("Failed to create Opus decoder (%d): %s", err, opus_strerror (err)));
|
||||
return GST_FLOW_ERROR;
|
||||
|
||||
buffer_failed:
|
||||
GST_ERROR_OBJECT (dec, "Failed to create %u byte buffer", packet_size);
|
||||
GST_ELEMENT_ERROR (dec, STREAM, DECODE,
|
||||
("Failed to create %u byte buffer", packet_size), (NULL));
|
||||
return GST_FLOW_ERROR;
|
||||
}
|
||||
|
||||
|
|
|
@ -1044,13 +1044,14 @@ gst_opus_enc_encode (GstOpusEnc * enc, GstBuffer * buf)
|
|||
gst_buffer_unmap (outbuf, &omap);
|
||||
|
||||
if (outsize < 0) {
|
||||
GST_ERROR_OBJECT (enc, "Encoding failed: %d", outsize);
|
||||
GST_ELEMENT_ERROR (enc, STREAM, ENCODE, ("Encoding failed"),
|
||||
("Encoding ifailed (%d): %s", outsize, opus_strerror (outsize)));
|
||||
ret = GST_FLOW_ERROR;
|
||||
goto done;
|
||||
} else if (outsize > max_payload_size) {
|
||||
GST_WARNING_OBJECT (enc,
|
||||
"Encoded size %d is higher than max payload size (%d bytes)",
|
||||
outsize, max_payload_size);
|
||||
GST_ELEMENT_ERROR (enc, STREAM, ENCODE, ("Encoder error"),
|
||||
("Encoded size %d is higher than max payload size (%d bytes)",
|
||||
outsize, max_payload_size));
|
||||
ret = GST_FLOW_ERROR;
|
||||
goto done;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue