Changes in src/io/source_sndfile.c [50e10a9:69440b8]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/io/source_sndfile.c
r50e10a9 r69440b8 59 59 // some temporary memory for sndfile to write at 60 60 uint_t scratch_size; 61 float *scratch_data;61 smpl_t *scratch_data; 62 62 }; 63 63 … … 199 199 } 200 200 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 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 219 208 if (read_data->height > input_channels) { 220 // destination matrix has more channels than the file; copy last channel 221 // of the file to each additional channels, de-interleaving data 209 // copy last channel to all additional channels 222 210 for (j = 0; j < read_samples / input_channels; j++) { 223 211 for (i = input_channels; i < read_data->height; i++) { 224 data[i][j] = (smpl_t)s->scratch_data[j * input_channels + (input_channels - 1)];212 data[i][j] = s->scratch_data[ j * input_channels + (input_channels - 1)]; 225 213 } 226 214 }
Note: See TracChangeset
for help on using the changeset viewer.