commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 01/15: runtime: always set max_noutput_item


From: git
Subject: [Commit-gnuradio] [gnuradio] 01/15: runtime: always set max_noutput_items.
Date: Wed, 10 Feb 2016 15:44:47 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch master
in repository gnuradio.

commit f02fb8b0af27ec26092fd7f174382d286a85b173
Author: Tom Rondeau <address@hidden>
Date:   Mon Jan 25 09:02:12 2016 -0500

    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.
---
 gnuradio-runtime/lib/flat_flowgraph.cc | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gnuradio-runtime/lib/flat_flowgraph.cc 
b/gnuradio-runtime/lib/flat_flowgraph.cc
index 81c1184..4dcbfbb 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;
   }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]