diff options
author | Josh Blum | 2012-10-13 16:17:56 -0700 |
---|---|---|
committer | Josh Blum | 2012-10-13 16:17:56 -0700 |
commit | e9e370f16b96563583e75855e9890c5d2d86c624 (patch) | |
tree | 8063328f5f489cc896982fc84bbd1af7f52b9b63 | |
parent | ac9abbbcfdbc5efc715ea49bb0319b2408cca359 (diff) | |
download | sandhi-e9e370f16b96563583e75855e9890c5d2d86c624.tar.gz sandhi-e9e370f16b96563583e75855e9890c5d2d86c624.tar.bz2 sandhi-e9e370f16b96563583e75855e9890c5d2d86c624.zip |
change to fixed_rate_noutput_to_ninput in block for non fixed rates
-rw-r--r-- | TODO.txt | 3 | ||||
-rw-r--r-- | lib/gr_block.cpp | 9 | ||||
-rw-r--r-- | lib/top_block.cpp | 1 |
3 files changed, 10 insertions, 3 deletions
@@ -8,6 +8,7 @@ * handle forecast ** not 100% sure here with the input/output edge case sizes +** forecast + input buffer accumulate * add hooks to specify input reserve ** automatically calculate from output multiple and rel rate @@ -38,7 +39,5 @@ and not directly from block::<method> * want per-port token_pool for inputs and outputs ** if ports get removed, this will release subscribers -* forecast + input buffer accumulate - * token check for top block stop ** fixes qa UDP so we dont wait for inert message diff --git a/lib/gr_block.cpp b/lib/gr_block.cpp index a384af1..b32158a 100644 --- a/lib/gr_block.cpp +++ b/lib/gr_block.cpp @@ -80,7 +80,14 @@ bool gr_block::is_unaligned(void) size_t gr_block::fixed_rate_noutput_to_ninput(const size_t noutput_items) { - return size_t(0.5 + (noutput_items/this->relative_rate())) + this->history() - 1; + if ((*this)->block->enable_fixed_rate) + { + return size_t(0.5 + (noutput_items/this->relative_rate())) + this->history() - 1; + } + else + { + return noutput_items + this->history() - 1; + } } size_t gr_block::interpolation(void) const diff --git a/lib/top_block.cpp b/lib/top_block.cpp index d71a4a7..a09744e 100644 --- a/lib/top_block.cpp +++ b/lib/top_block.cpp @@ -107,6 +107,7 @@ void TopBlock::run(void) { this->start(); this->wait(); + this->disconnect_all(); } GRAS_FORCE_INLINE void wait_thread_yield(void) |