add API to use a plugin provided bypass control port
[ardour.git] / libs / ardour / resampled_source.cc
index 5c811706d004a57bf94eecb554121dd6962dff12..04eecf0dee9eebadd93a1991aff0e5fbe5d09694 100644 (file)
@@ -73,14 +73,15 @@ framecnt_t
 ResampledImportableSource::read (Sample* output, framecnt_t nframes)
 {
        int err;
+       size_t bs = floor ((float)(blocksize / source->channels())) *  source->channels();
 
        /* If the input buffer is empty, refill it. */
        if (_src_data.input_frames == 0) {
 
-               _src_data.input_frames = source->read (_input, blocksize);
+               _src_data.input_frames = source->read (_input, bs);
 
                /* The last read will not be a full buffer, so set end_of_input. */
-               if ((framecnt_t) _src_data.input_frames < blocksize) {
+               if ((framecnt_t) _src_data.input_frames < bs) {
                        _end_of_input = true;
                }