From 99c2b220675f3ca73ef5cf0a9ebe03706f813d61 Mon Sep 17 00:00:00 2001 From: Tom Rondeau 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(-) diff --git a/gnuradio-core/src/lib/runtime/gr_buffer.cc b/gnuradio-core/src/lib/runtime/gr_buffer.cc index 3c935b960..624ca78a8 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