Changeset 776a5d3 for src/io


Ignore:
Timestamp:
Jul 16, 2012, 2:48:03 AM (12 years ago)
Author:
Paul Brossier <piem@piem.org>
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:
e3b5962
Parents:
65525fe
Message:

src/io/sink_sndfile.c: ident and simplify

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/io/sink_sndfile.c

    r65525fe r776a5d3  
    8787
    8888void aubio_sink_sndfile_do(aubio_sink_sndfile_t *s, fvec_t * write_data, uint_t write){
    89   sf_count_t written_frames = 0;
    90   int i, j,     channels = s->channels;
     89  uint_t i, j,  channels = s->channels;
    9190  int nsamples = channels*write;
    9291  smpl_t *pwrite;
     
    101100  for ( i = 0; i < channels; i++) {
    102101    pwrite = (smpl_t *)write_data->data;
    103     for (j=0; j < write; j++) {
     102    for (j = 0; j < write; j++) {
    104103      s->scratch_data[channels*j+i] = pwrite[j];
    105104    }
    106105  }
    107106
    108   uint_t written = sf_write_float (s->handle, s->scratch_data, nsamples);
    109   if (written/channels != write) {
     107  sf_count_t written_frames = sf_write_float (s->handle, s->scratch_data, nsamples);
     108  if (written_frames/channels != write) {
    110109    AUBIO_WRN("trying to write %d frames to %s, but only %d could be written",
    111       write, s->path, written);
     110      write, s->path, (uint_t)written_frames);
    112111  }
    113112  return;
Note: See TracChangeset for help on using the changeset viewer.