basesrc: Clear submitted buffer lists consistently with buffers

And handle the case of a NULL buffer being returned cleanly, which is
valid as long as a buffer list is returned instead. Previously this
would cause an assertion because of calling gst_buffer_unref() with
NULL.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6460>
This commit is contained in:
Sebastian Dröge 2024-03-27 17:05:09 +02:00 committed by GStreamer Marge Bot
parent 6a67ae1bfa
commit 6d3ed65179

View file

@ -2637,7 +2637,8 @@ retry_create:
/* no need keep old buffer while in pause */
if (ret == GST_FLOW_OK && own_res_buf)
gst_buffer_unref (res_buf);
gst_clear_buffer (&res_buf);
gst_clear_buffer_list (&src->priv->pending_bufferlist);
wait_ret = gst_base_src_wait_playing_unlocked (src);
if (wait_ret != GST_FLOW_OK) {
@ -2655,7 +2656,8 @@ retry_create:
if (G_UNLIKELY (g_atomic_int_get (&src->priv->has_pending_eos))) {
if (ret == GST_FLOW_OK) {
if (own_res_buf)
gst_buffer_unref (res_buf);
gst_clear_buffer (&res_buf);
gst_clear_buffer_list (&src->priv->pending_bufferlist);
}
src->priv->forced_eos = TRUE;
goto eos;