diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2020-12-11 16:26:00 -0500 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2021-04-08 00:38:47 +0000 |
commit | e041ff697d2ba33f1d71db70451eb6ddacff844c (patch) | |
tree | 731a0bb83536c291962136cc3f294f1d4bfcb8f3 /ext | |
parent | f449a553a76846c27a5cd229a197070e7059071f (diff) | |
download | gstreamer-plugins-bad-e041ff697d2ba33f1d71db70451eb6ddacff844c.tar.gz |
sbc: Return hard error on allocation or mapping error
Also post a message on the bus in these cases.wpe: Emit load-progress messages
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1875>
Diffstat (limited to 'ext')
-rw-r--r-- | ext/sbc/gstsbcenc.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/ext/sbc/gstsbcenc.c b/ext/sbc/gstsbcenc.c index 8948df87c..d4f9b633c 100644 --- a/ext/sbc/gstsbcenc.c +++ b/ext/sbc/gstsbcenc.c @@ -288,8 +288,6 @@ gst_sbc_enc_handle_frame (GstAudioEncoder * audio_enc, GstBuffer * buffer) gst_buffer_replace (&outbuf, NULL); } -done: - gst_buffer_unmap (buffer, &in_map); return gst_audio_encoder_finish_frame (audio_enc, outbuf, @@ -298,13 +296,16 @@ done: /* ERRORS */ no_buffer: { - GST_ERROR_OBJECT (enc, "could not allocate output buffer"); - goto done; + gst_buffer_unmap (buffer, &in_map); + GST_ELEMENT_ERROR (enc, STREAM, FAILED, (NULL), + ("Could not allocate output buffer")); + return GST_FLOW_ERROR; } map_failed: { - GST_ERROR_OBJECT (enc, "could not map input buffer"); - goto done; + GST_ELEMENT_ERROR (enc, STREAM, FAILED, (NULL), + ("Could not allocate output buffer")); + return GST_FLOW_ERROR; } } |