mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
audioencoder: reshuffle code in error handling
Move the assert to the error handling block at the end of the function so the the logging is still triggered. Reword the logging slightly and add another comment to hint what went wrong. Fixes #737138
This commit is contained in:
parent
cabe5746fb
commit
5f0aad6f42
1 changed files with 5 additions and 4 deletions
|
@ -741,9 +741,7 @@ gst_audio_encoder_finish_frame (GstAudioEncoder * enc, GstBuffer * buf,
|
|||
/* advance sample view */
|
||||
if (G_UNLIKELY (samples * ctx->info.bpf > priv->offset)) {
|
||||
if (G_LIKELY (!priv->force)) {
|
||||
/* no way we can let this pass */
|
||||
g_assert_not_reached ();
|
||||
/* really no way */
|
||||
/* we should have received EOS to enable force */
|
||||
goto overflow;
|
||||
} else {
|
||||
priv->offset = 0;
|
||||
|
@ -893,11 +891,14 @@ no_caps:
|
|||
overflow:
|
||||
{
|
||||
GST_ELEMENT_ERROR (enc, STREAM, ENCODE,
|
||||
("received more encoded samples %d than provided %d",
|
||||
("received more encoded samples %d than provided %d as inputs",
|
||||
samples, priv->offset / ctx->info.bpf), (NULL));
|
||||
if (buf)
|
||||
gst_buffer_unref (buf);
|
||||
ret = GST_FLOW_ERROR;
|
||||
/* no way we can let this pass */
|
||||
g_assert_not_reached ();
|
||||
/* really no way */
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue