diff options
author | Josh Blum | 2012-10-13 14:58:18 -0700 |
---|---|---|
committer | Josh Blum | 2012-10-13 14:58:18 -0700 |
commit | b0e1ca63f8db775557d155b6b7d703f3bf251386 (patch) | |
tree | 618376dd17123da88741f7fbb733651f2cf80b09 /lib/block_task.cpp | |
parent | 8354c9c4c92687904cedae0b0feb702c2d7e8408 (diff) | |
download | sandhi-b0e1ca63f8db775557d155b6b7d703f3bf251386.tar.gz sandhi-b0e1ca63f8db775557d155b6b7d703f3bf251386.tar.bz2 sandhi-b0e1ca63f8db775557d155b6b7d703f3bf251386.zip |
handle_update_inputs also performs resize, cleanup input fixed rate logic
Diffstat (limited to 'lib/block_task.cpp')
-rw-r--r-- | lib/block_task.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/block_task.cpp b/lib/block_task.cpp index 1570064..fac70c0 100644 --- a/lib/block_task.cpp +++ b/lib/block_task.cpp @@ -114,10 +114,17 @@ void BlockActor::handle_task(void) this->input_items[i].size() = items; this->work_input_items[i] = mem; this->work_ninput_items[i] = items; + if (this->enable_fixed_rate) { - items = std::max<int>(0, int(items) - int(this->input_configs[i].lookahead_items)); + if (items <= this->input_configs[i].lookahead_items) + { + if (this->inputs_done[i]) this->mark_done(); + return; + } + items -= this->input_configs[i].lookahead_items; } + num_input_items = std::min(num_input_items, items); this->consume_items[i] = 0; this->consume_called[i] = false; @@ -181,6 +188,7 @@ void BlockActor::handle_task(void) //------------------------------------------------------------------ //-- forecast //------------------------------------------------------------------ + VAR(work_noutput_items); if (this->forecast_enable) { forecast_again_you_jerk: @@ -207,6 +215,8 @@ void BlockActor::handle_task(void) //------------------------------------------------------------------ //-- the work //------------------------------------------------------------------ + VAR(work_noutput_items); + if (num_inputs) VAR(work_ninput_items[0]); this->work_ret = -1; if (this->interruptible_thread) { |