From 99c2b220675f3ca73ef5cf0a9ebe03706f813d61 Mon Sep 17 00:00:00 2001
From: Tom Rondeau <trondeau@vt.edu>
Date: Tue, 4 Jan 2011 11:10:27 -0500
Subject: Only prune if we've moved on in the number of items read. Fixes the
 problem or premature pruning.

---
 gnuradio-core/src/lib/runtime/gr_buffer.cc | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

(limited to 'gnuradio-core/src/lib/runtime/gr_buffer.cc')

diff --git a/gnuradio-core/src/lib/runtime/gr_buffer.cc b/gnuradio-core/src/lib/runtime/gr_buffer.cc
index 3c935b9608..624ca78a88 100644
--- a/gnuradio-core/src/lib/runtime/gr_buffer.cc
+++ b/gnuradio-core/src/lib/runtime/gr_buffer.cc
@@ -163,9 +163,10 @@ gr_buffer::space_available ()
       min_items_read = std::min(min_items_read, d_readers[i]->nitems_read());
     }
 
-    //prune_tags(min_items_read);
-    prune_tags(d_last_min_items_read);
-    d_last_min_items_read = min_items_read;
+    if(min_items_read != d_last_min_items_read) {
+      prune_tags(d_last_min_items_read);
+      d_last_min_items_read = min_items_read;
+    }
 
     // The -1 ensures that the case d_write_index == d_read_index is
     // unambiguous.  It indicates that there is no data for the reader
-- 
cgit v1.2.3