mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
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:
parent
f449a553a7
commit
e041ff697d
1 changed files with 7 additions and 6 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue