diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2015-03-14 21:07:01 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2015-03-14 21:09:50 +0000 |
commit | 01e44969dfc664d010da16172c96173ae1acefbe (patch) | |
tree | 9aa77393d6f13e2f324c9e9d5dfe490882c02cda | |
parent | 2b4d066355b7d8b25cc3699277e22513c73096e4 (diff) |
basesink: handle empty buffer list more gracefully
Don't abort, just ignore it. It's like a buffer
without memories.
-rw-r--r-- | libs/gst/base/gstbasesink.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c index 14c2371b2..a50569577 100644 --- a/libs/gst/base/gstbasesink.c +++ b/libs/gst/base/gstbasesink.c @@ -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"); |