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>
This commit is contained in:
Olivier Crête 2020-12-11 16:26:00 -05:00 committed by GStreamer Marge Bot
parent f449a553a7
commit e041ff697d

View file

@ -288,8 +288,6 @@ gst_sbc_enc_handle_frame (GstAudioEncoder * audio_enc, GstBuffer * buffer)
gst_buffer_replace (&outbuf, NULL); gst_buffer_replace (&outbuf, NULL);
} }
done:
gst_buffer_unmap (buffer, &in_map); gst_buffer_unmap (buffer, &in_map);
return gst_audio_encoder_finish_frame (audio_enc, outbuf, return gst_audio_encoder_finish_frame (audio_enc, outbuf,
@ -298,13 +296,16 @@ done:
/* ERRORS */ /* ERRORS */
no_buffer: no_buffer:
{ {
GST_ERROR_OBJECT (enc, "could not allocate output buffer"); gst_buffer_unmap (buffer, &in_map);
goto done; GST_ELEMENT_ERROR (enc, STREAM, FAILED, (NULL),
("Could not allocate output buffer"));
return GST_FLOW_ERROR;
} }
map_failed: map_failed:
{ {
GST_ERROR_OBJECT (enc, "could not map input buffer"); GST_ELEMENT_ERROR (enc, STREAM, FAILED, (NULL),
goto done; ("Could not allocate output buffer"));
return GST_FLOW_ERROR;
} }
} }