queue2: fix merging of ranges
authorWim Taymans <wim.taymans@collabora.co.uk>
Mon, 21 Jun 2010 09:41:46 +0000 (11:41 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Mon, 21 Jun 2010 09:41:46 +0000 (11:41 +0200)
When we merge two ranges, don't updata the current range writing_pos with
whereever we were writing earlier in the merged range.  Spotted by bilboed.

plugins/elements/gstqueue2.c

index 8dd55f8..83af4b9 100644 (file)
@@ -947,10 +947,12 @@ gst_queue2_write_buffer_to_file (GstQueue2 * queue, GstBuffer * buffer)
 
     GST_DEBUG_OBJECT (queue, "merging ranges %" G_GUINT64_FORMAT,
         next->writing_pos);
-    /* we ran over the offset of the next group */
-    queue->current->writing_pos = writing_pos = next->writing_pos;
 
-    /* remove the group */
+    /* remove the group, we could choose to not read the data in this range
+     * again. This would involve us doing a seek to the current writing position
+     * in the range. FIXME, It would probably make sense to do a seek when there
+     * is a lot of data in the range we merged with to avoid reading it all
+     * again. */
     queue->current->next = next->next;
     g_slice_free (GstQueue2Range, next);