adapter: remove _try_to_merge_up()
authorWim Taymans <wim.taymans@collabora.co.uk>
Tue, 1 May 2012 08:50:32 +0000 (10:50 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Tue, 1 May 2012 08:50:32 +0000 (10:50 +0200)
It causes the timestamp to go wrong, should not cause much of a performance
increase and in the cases where it is faster, it is broken in 0.10 as well.
We should try to review this when rewriting the adapter for 0.11 memory
features.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=674791

libs/gst/base/gstadapter.c
tests/check/libs/adapter.c

index 9354674..b27edcf 100644 (file)
@@ -349,6 +349,7 @@ gst_adapter_push (GstAdapter * adapter, GstBuffer * buf)
   }
 }
 
+#if 0
 /* Internal method only. Tries to merge buffers at the head of the queue
  * to form a single larger buffer of size 'size'.
  *
@@ -404,6 +405,7 @@ gst_adapter_try_to_merge_up (GstAdapter * adapter, gsize size)
 
   return ret;
 }
+#endif
 
 /**
  * gst_adapter_map:
@@ -451,7 +453,9 @@ gst_adapter_map (GstAdapter * adapter, gsize size)
   if (adapter->assembled_len >= size)
     return adapter->assembled_data;
 
+#if 0
   do {
+#endif
     cur = adapter->buflist->data;
     skip = adapter->skip;
 
@@ -464,7 +468,9 @@ gst_adapter_map (GstAdapter * adapter, gsize size)
     }
     /* We may be able to efficiently merge buffers in our pool to
      * gather a big enough chunk to return it from the head buffer directly */
+#if 0
   } while (gst_adapter_try_to_merge_up (adapter, size));
+#endif
 
   /* see how much data we can reuse from the assembled memory and how much
    * we need to copy */
@@ -757,7 +763,7 @@ gst_adapter_take_buffer (GstAdapter * adapter, gsize nbytes)
     buffer = gst_buffer_copy_region (cur, GST_BUFFER_COPY_ALL, skip, nbytes);
     goto done;
   }
-
+#if 0
   if (gst_adapter_try_to_merge_up (adapter, nbytes)) {
     /* Merged something, let's try again for sub-buffering */
     cur = adapter->buflist->data;
@@ -769,6 +775,7 @@ gst_adapter_take_buffer (GstAdapter * adapter, gsize nbytes)
       goto done;
     }
   }
+#endif
 
   data = gst_adapter_take_internal (adapter, nbytes);
 
index 19122f0..e3b801a 100644 (file)
@@ -257,8 +257,10 @@ GST_START_TEST (test_take3)
   avail = gst_adapter_available (adapter);
   fail_unless (avail == 0);
 
-  /* the data should be the same */
+#if 0
+  /* the data should be the same FIXME, implement span in adapter again. */
   fail_unless (info.data == info2.data);
+#endif
 
   gst_buffer_unmap (buffer2, &info2);
   gst_buffer_unref (buffer2);