basesink: handle empty buffer list more gracefully

Don't abort, just ignore it. It's like a buffer
without memories.
This commit is contained in:
Tim-Philipp Müller 2015-03-14 21:07:01 +00:00
parent 2b4d066355
commit 01e44969df

View file

@ -3296,7 +3296,12 @@ gst_base_sink_chain_unlocked (GstBaseSink * basesink, GstPad * pad,
goto was_eos;
if (is_list) {
sync_buf = gst_buffer_list_get (GST_BUFFER_LIST_CAST (obj), 0);
GstBufferList *buffer_list = GST_BUFFER_LIST_CAST (obj);
if (gst_buffer_list_length (buffer_list) == 0)
goto empty_list;
sync_buf = gst_buffer_list_get (buffer_list, 0);
g_assert (NULL != sync_buf);
} else {
sync_buf = GST_BUFFER_CAST (obj);
@ -3478,6 +3483,12 @@ was_eos:
gst_mini_object_unref (GST_MINI_OBJECT_CAST (obj));
return GST_FLOW_EOS;
}
empty_list:
{
GST_DEBUG_OBJECT (basesink, "buffer list with no buffers");
gst_mini_object_unref (GST_MINI_OBJECT_CAST (obj));
return GST_FLOW_OK;
}
out_of_segment:
{
GST_DEBUG_OBJECT (basesink, "dropping buffer, out of clipping segment");