summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gnuradio-core/src/lib/runtime/gr_block_executor.cc4
-rw-r--r--gnuradio-core/src/lib/runtime/gr_random_annotator.cc7
-rw-r--r--gnuradio-core/src/lib/runtime/gr_random_annotator.h1
3 files changed, 9 insertions, 3 deletions
diff --git a/gnuradio-core/src/lib/runtime/gr_block_executor.cc b/gnuradio-core/src/lib/runtime/gr_block_executor.cc
index 804c9e197..840cf8e5c 100644
--- a/gnuradio-core/src/lib/runtime/gr_block_executor.cc
+++ b/gnuradio-core/src/lib/runtime/gr_block_executor.cc
@@ -343,9 +343,9 @@ gr_block_executor::run_one_iteration()
for (int i = 0; i < d->noutputs (); i++)
d_output_items[i] = d->output(i)->write_pointer();
- // store number of items consumed so far on in stream
+ // determine where to start looking for new tags as 1 past nitems read
for (int i = 0; i < d->ninputs(); i++)
- d_start_nitems_read[i] = d->nitems_read(i);
+ d_start_nitems_read[i] = d->nitems_read(i)+1;
// Do the actual work of the block
int n = m->general_work (noutput_items, d_ninput_items,
diff --git a/gnuradio-core/src/lib/runtime/gr_random_annotator.cc b/gnuradio-core/src/lib/runtime/gr_random_annotator.cc
index 08589984e..366130984 100644
--- a/gnuradio-core/src/lib/runtime/gr_random_annotator.cc
+++ b/gnuradio-core/src/lib/runtime/gr_random_annotator.cc
@@ -42,6 +42,11 @@ gr_random_annotator::gr_random_annotator (size_t sizeof_stream_item)
gr_make_io_signature (1, -1, sizeof_stream_item)),
d_itemsize(sizeof_stream_item)
{
+ //set_tag_propagation_policy(TPP_DONT);
+ set_tag_propagation_policy(TPP_ALL_TO_ALL);
+ //set_tag_propagation_policy(TPP_ONE_TO_ONE);
+
+ d_tag_counter = 0;
}
gr_random_annotator::~gr_random_annotator ()
@@ -86,7 +91,7 @@ gr_random_annotator::work (int noutput_items,
}
// Storing the current noutput_items as the value to the "noutput_items" key
- pmt::pmt_t cur_N = pmt::pmt_from_uint64(random());
+ pmt::pmt_t cur_N = pmt::pmt_from_uint64(d_tag_counter++);
pmt::pmt_t srcid = pmt::pmt_string_to_symbol(str.str());
pmt::pmt_t key = pmt::pmt_string_to_symbol("noutput_items");
add_item_tag(0, abs_N, key, cur_N, srcid);
diff --git a/gnuradio-core/src/lib/runtime/gr_random_annotator.h b/gnuradio-core/src/lib/runtime/gr_random_annotator.h
index 3f21b71ad..5fca53830 100644
--- a/gnuradio-core/src/lib/runtime/gr_random_annotator.h
+++ b/gnuradio-core/src/lib/runtime/gr_random_annotator.h
@@ -46,6 +46,7 @@ protected:
private:
size_t d_itemsize;
std::stringstream d_sout;
+ uint64_t d_tag_counter;
friend gr_random_annotator_sptr
gr_make_random_annotator (size_t sizeof_stream_item);