+ g_return_if_fail (idx < list->n_buffers);
+ g_return_if_fail (idx + length <= list->n_buffers);
+ g_return_if_fail (gst_buffer_list_is_writable (list));
+
+ gst_buffer_list_remove_range_internal (list, idx, length, TRUE);
+}
+
+/**
+ * gst_buffer_list_copy_deep:
+ * @list: a #GstBufferList
+ *
+ * Create a copy of the given buffer list. This will make a newly allocated
+ * copy of the buffer that the source buffer list contains.
+ *
+ * Returns: (transfer full): a new copy of @list.
+ *
+ * Since: 1.6
+ */
+GstBufferList *
+gst_buffer_list_copy_deep (const GstBufferList * list)
+{
+ guint i, len;
+ GstBufferList *result = NULL;
+
+ g_return_val_if_fail (GST_IS_BUFFER_LIST (list), NULL);
+
+ result = gst_buffer_list_new ();
+
+ len = list->n_buffers;
+ for (i = 0; i < len; i++) {
+ GstBuffer *old = list->buffers[i];
+ GstBuffer *new = gst_buffer_copy_deep (old);
+
+ if (G_LIKELY (new)) {
+ gst_buffer_list_insert (result, i, new);
+ } else {
+ g_warning
+ ("Failed to deep copy buffer %p while deep "
+ "copying buffer list %p. Buffer list copy "
+ "will be incomplete", old, list);
+ }
+ }