summaryrefslogtreecommitdiff
path: root/lib/block_handlers.cpp
diff options
context:
space:
mode:
authorJosh Blum2012-09-19 12:16:27 -0700
committerJosh Blum2012-09-19 12:16:27 -0700
commite6020edf49b81dca6fcf3bd1eafbb2ea0415e2a2 (patch)
tree3cf017f9b606868f96d0ef61c4aca8ed183a633d /lib/block_handlers.cpp
parentd0735919f03dd0aa4d79fcd768cf4393684eb389 (diff)
downloadsandhi-e6020edf49b81dca6fcf3bd1eafbb2ea0415e2a2.tar.gz
sandhi-e6020edf49b81dca6fcf3bd1eafbb2ea0415e2a2.tar.bz2
sandhi-e6020edf49b81dca6fcf3bd1eafbb2ea0415e2a2.zip
a few more forecast related tweaks
Diffstat (limited to 'lib/block_handlers.cpp')
-rw-r--r--lib/block_handlers.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/block_handlers.cpp b/lib/block_handlers.cpp
index 6db4ca3..a3a42b6 100644
--- a/lib/block_handlers.cpp
+++ b/lib/block_handlers.cpp
@@ -177,7 +177,7 @@ void ElementImpl::topology_update(const tsbe::TaskInterface &task_iface)
this->produce_items.resize(num_outputs, 0);
this->input_queues.resize(num_inputs);
this->output_queues.resize(num_outputs);
- this->forecast_enable = true;
+ this->forecast_enable = num_outputs != 0 and num_inputs != 0;
this->input_tokens.resize(num_inputs);
this->output_tokens.resize(num_outputs);
@@ -209,7 +209,10 @@ void ElementImpl::input_update(const tsbe::TaskInterface &task_iface)
{
//TODO, this is a little cheap, we only look at output multiple [0]
const size_t multiple = (num_outputs)?this->output_multiple_items.front():1;
- this->input_multiple_items[i] = size_t(std::ceil(multiple/this->relative_rate));
+ if (this->enable_fixed_rate)
+ {
+ this->input_multiple_items[i] = size_t(std::ceil(multiple/this->relative_rate));
+ }
if (this->input_multiple_items[i] == 0) this->input_multiple_items[i] = 1;
}