summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/lib/flat_flowgraph.cc
diff options
context:
space:
mode:
authorTom Rondeau <tom@trondeau.com>2016-01-25 09:02:12 -0500
committerTom Rondeau <tom@trondeau.com>2016-01-28 06:22:06 -0500
commitf02fb8b0af27ec26092fd7f174382d286a85b173 (patch)
tree43727c58c0f149181024a236771f2b085722ac90 /gnuradio-runtime/lib/flat_flowgraph.cc
parent161147d5e4d0e5951c6b6e3389353298a3eae05a (diff)
runtime: always set max_noutput_items.
This makes sure that max_noutput_items() returns a valid number once the flowgraph is created. This means we can get the max number of items a buffer will ever be able to see in the block's start() function.
Diffstat (limited to 'gnuradio-runtime/lib/flat_flowgraph.cc')
-rw-r--r--gnuradio-runtime/lib/flat_flowgraph.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/gnuradio-runtime/lib/flat_flowgraph.cc b/gnuradio-runtime/lib/flat_flowgraph.cc
index 81c1184cfa..4dcbfbb281 100644
--- a/gnuradio-runtime/lib/flat_flowgraph.cc
+++ b/gnuradio-runtime/lib/flat_flowgraph.cc
@@ -177,6 +177,13 @@ namespace gr {
catch(std::bad_alloc&) {
b = make_buffer(nitems, item_size, grblock);
}
+
+ // Set the max noutput items size here to make sure it's always
+ // set in the block and available in the start() method.
+ // But don't overwrite if the user has set this externally.
+ if(!grblock->is_set_max_noutput_items())
+ grblock->set_max_noutput_items(nitems);
+
return b;
}