Changeset dc467b5d for src/io/source_sndfile.c
- Timestamp:
- Oct 27, 2013, 12:44:29 PM (10 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- 8247249
- Parents:
- dd15573 (diff), 7fc5ba2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/io/source_sndfile.c
rdd15573 rdc467b5d 59 59 // some temporary memory for sndfile to write at 60 60 uint_t scratch_size; 61 smpl_t *scratch_data;61 float *scratch_data; 62 62 }; 63 63 … … 199 199 } 200 200 201 /* de-interleaving data */ 202 for (j = 0; j < read_samples / input_channels; j++) { 203 for (i = 0; i < input_channels; i++) { 204 data[i][j] = (smpl_t)s->scratch_data[input_channels*j+i]; 205 } 206 } 207 // if read_data has more channels than the file 201 if (read_data->height < input_channels) { 202 // destination matrix has less channels than the file; copy only first 203 // channels of the file, de-interleaving data 204 for (j = 0; j < read_samples / input_channels; j++) { 205 for (i = 0; i < read_data->height; i++) { 206 data[i][j] = (smpl_t)s->scratch_data[j * input_channels + i]; 207 } 208 } 209 } else { 210 // destination matrix has as many or more channels than the file; copy each 211 // channel from the file to the destination matrix, de-interleaving data 212 for (j = 0; j < read_samples / input_channels; j++) { 213 for (i = 0; i < input_channels; i++) { 214 data[i][j] = (smpl_t)s->scratch_data[j * input_channels + i]; 215 } 216 } 217 } 218 208 219 if (read_data->height > input_channels) { 209 // copy last channel to all additional channels 220 // destination matrix has more channels than the file; copy last channel 221 // of the file to each additional channels, de-interleaving data 210 222 for (j = 0; j < read_samples / input_channels; j++) { 211 223 for (i = input_channels; i < read_data->height; i++) { 212 data[i][j] = s->scratch_data[j * input_channels + (input_channels - 1)];224 data[i][j] = (smpl_t)s->scratch_data[j * input_channels + (input_channels - 1)]; 213 225 } 214 226 }
Note: See TracChangeset
for help on using the changeset viewer.