- // if read_data has more channels than the file
- if (read_to->height > s->channels) {
- // copy last channel to all additional channels
- for (v = 0; v < loadedPackets; v++) {
- for (c = s->channels; c < read_to->height; c++) {
- read_to->data[c][v] = data[ v * s->channels + (s->channels - 1)];
- }
- }
- }
- // short read, fill with zeros
- if (loadedPackets < s->block_size) {
- for (v = loadedPackets; v < s->block_size; v++) {
- for (c = 0; c < read_to->height; c++) {
- read_to->data[c][v] = 0.;
- }
- }
- }