summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gnuradio-runtime/include/gnuradio/tagged_stream_block.h2
-rw-r--r--gnuradio-runtime/lib/tagged_stream_block.cc12
2 files changed, 13 insertions, 1 deletions
diff --git a/gnuradio-runtime/include/gnuradio/tagged_stream_block.h b/gnuradio-runtime/include/gnuradio/tagged_stream_block.h
index 1fe92ee25a..86343f281d 100644
--- a/gnuradio-runtime/include/gnuradio/tagged_stream_block.h
+++ b/gnuradio-runtime/include/gnuradio/tagged_stream_block.h
@@ -97,6 +97,8 @@ namespace gr {
*/
void /* final */ forecast (int noutput_items, gr_vector_int &ninput_items_required);
+ bool check_topology(int ninputs, int /* noutputs */);
+
/*!
* - Reads the number of input items from the tags using parse_length_tags()
* - Checks there's enough data on the input and output buffers
diff --git a/gnuradio-runtime/lib/tagged_stream_block.cc b/gnuradio-runtime/lib/tagged_stream_block.cc
index c6d5fc1fec..252a235fbf 100644
--- a/gnuradio-runtime/lib/tagged_stream_block.cc
+++ b/gnuradio-runtime/lib/tagged_stream_block.cc
@@ -89,6 +89,14 @@ namespace gr {
return;
}
+ bool
+ tagged_stream_block::check_topology(int ninputs, int /* noutputs */)
+ {
+ d_n_input_items_reqd.resize(ninputs, 0);
+ return true;
+ }
+
+
int
tagged_stream_block::general_work(int noutput_items,
gr_vector_int &ninput_items,
@@ -99,7 +107,9 @@ namespace gr {
return work(noutput_items, ninput_items, input_items, output_items);
}
- if(d_n_input_items_reqd[0] == 0) { // Otherwise, it's already set from a previous call
+ // Read TSB tags, unless we...
+ // ...don't have inputs or ... ... we already set it in a previous run.
+ if(!d_n_input_items_reqd.empty() && d_n_input_items_reqd[0] == 0) {
std::vector<std::vector<tag_t> > tags(input_items.size(), std::vector<tag_t>());
for(unsigned i = 0; i < input_items.size(); i++) {
get_tags_in_range(tags[i], i, nitems_read(i), nitems_read(i)+1);