summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rondeau <tom@trondeau.com>2016-01-06 16:59:42 -0500
committerTom Rondeau <tom@trondeau.com>2016-01-06 17:18:56 -0500
commitf44e66c9c21062037db19b8fd98f33984dff36e0 (patch)
treed44364209125a93484441fb93eb4d61f4b5b7d7a
parentdec480ab3f0809677ba3ef2a3a64d402d742b5ec (diff)
analog: Addresses issue #831.
We changed from using set_output_multiple(interpolate) because data would not necessarily continue to flow through properly. This meant that we needed to check the input size in the work function because if we cycle through the filters, we can sometimes consume more inputs than we've been given, which messes up the consume/produce and bookkeeping. It's likely that we can find a better form of the forecast function here that does not require checking both noutput_items and ninput_items[0] in the while loop.
-rw-r--r--gr-filter/lib/rational_resampler_base_XXX_impl.cc.t6
1 files changed, 4 insertions, 2 deletions
diff --git a/gr-filter/lib/rational_resampler_base_XXX_impl.cc.t b/gr-filter/lib/rational_resampler_base_XXX_impl.cc.t
index ef98af3037..0b74e60969 100644
--- a/gr-filter/lib/rational_resampler_base_XXX_impl.cc.t
+++ b/gr-filter/lib/rational_resampler_base_XXX_impl.cc.t
@@ -154,19 +154,21 @@ namespace gr {
}
unsigned int ctr = d_ctr;
+ int count = 0;
int i = 0;
- while(i < noutput_items) {
+ while((i < noutput_items) && (count < ninput_items[0])) {
out[i++] = d_firs[ctr]->filter(in);
ctr += decimation();
while(ctr >= interpolation()) {
ctr -= interpolation();
in++;
+ count++;
}
}
d_ctr = ctr;
- consume_each(in - (@I_TYPE@*)input_items[0]);
+ consume_each(count);
return i;
}