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 a579c882d6
commit 39435ec128

View file

@ -3288,7 +3288,12 @@ gst_base_sink_chain_unlocked (GstBaseSink * basesink, GstPad * pad,
goto was_eos; goto was_eos;
if (is_list) { 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); g_assert (NULL != sync_buf);
} else { } else {
sync_buf = GST_BUFFER_CAST (obj); sync_buf = GST_BUFFER_CAST (obj);
@ -3470,6 +3475,12 @@ was_eos:
gst_mini_object_unref (GST_MINI_OBJECT_CAST (obj)); gst_mini_object_unref (GST_MINI_OBJECT_CAST (obj));
return GST_FLOW_EOS; 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: out_of_segment:
{ {
GST_DEBUG_OBJECT (basesink, "dropping buffer, out of clipping segment"); GST_DEBUG_OBJECT (basesink, "dropping buffer, out of clipping segment");