PFB resampler: fix it this way to avoid the signed/unsigned warning.
[debian/gnuradio] / gnuradio-core / src / lib / filter / gr_pfb_arb_resampler_ccf.cc
index 5a6e753ab4c2b45d61ee4e432fae921d0b9668d4..add106b69b20704a49b054a9fa2a968182658a75 100644 (file)
@@ -34,7 +34,7 @@ gr_pfb_arb_resampler_ccf_sptr gr_make_pfb_arb_resampler_ccf (float rate,
                                                             const std::vector<float> &taps,
                                                             unsigned int filter_size)
 {
-  return gr_pfb_arb_resampler_ccf_sptr (new gr_pfb_arb_resampler_ccf (rate, taps,
+  return gnuradio::get_initial_sptr(new gr_pfb_arb_resampler_ccf (rate, taps,
                                                                      filter_size));
 }
 
@@ -178,7 +178,8 @@ gr_pfb_arb_resampler_ccf::general_work (int noutput_items,
   j = d_last_filter;
 
   // produce output as long as we can and there are enough input samples
-  while((i < noutput_items) && (count < ninput_items[0]-1)) {
+  int max_input = ninput_items[0]-(int)d_taps_per_filter;
+  while((i < noutput_items) && (count < max_input)) {
 
     // start j by wrapping around mod the number of channels
     while((j < d_int_rate) && (i < noutput_items)) {