From 0a84d8190138c82f74fe7276a6b6dc54a0a4f3a8 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 21 Jun 2010 11:41:46 +0200 Subject: [PATCH] queue2: fix merging of ranges 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 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/elements/gstqueue2.c b/plugins/elements/gstqueue2.c index 8dd55f8..83af4b9 100644 --- a/plugins/elements/gstqueue2.c +++ b/plugins/elements/gstqueue2.c @@ -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); -- 2.7.4