From: Paul Brossier Date: Mon, 16 Jul 2012 00:48:03 +0000 (-0600) Subject: src/io/sink_sndfile.c: ident and simplify X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=776a5d338831c2dc82a5688a2ef940bbfed358f0;p=aubio.git src/io/sink_sndfile.c: ident and simplify --- diff --git a/src/io/sink_sndfile.c b/src/io/sink_sndfile.c index 46ea10a9..801b929a 100644 --- a/src/io/sink_sndfile.c +++ b/src/io/sink_sndfile.c @@ -86,8 +86,7 @@ aubio_sink_sndfile_t * new_aubio_sink_sndfile(char_t * path, uint_t samplerate) } void aubio_sink_sndfile_do(aubio_sink_sndfile_t *s, fvec_t * write_data, uint_t write){ - sf_count_t written_frames = 0; - int i, j, channels = s->channels; + uint_t i, j, channels = s->channels; int nsamples = channels*write; smpl_t *pwrite; @@ -100,15 +99,15 @@ void aubio_sink_sndfile_do(aubio_sink_sndfile_t *s, fvec_t * write_data, uint_t /* interleaving data */ for ( i = 0; i < channels; i++) { pwrite = (smpl_t *)write_data->data; - for (j=0; j < write; j++) { + for (j = 0; j < write; j++) { s->scratch_data[channels*j+i] = pwrite[j]; } } - uint_t written = sf_write_float (s->handle, s->scratch_data, nsamples); - if (written/channels != write) { + sf_count_t written_frames = sf_write_float (s->handle, s->scratch_data, nsamples); + if (written_frames/channels != write) { AUBIO_WRN("trying to write %d frames to %s, but only %d could be written", - write, s->path, written); + write, s->path, (uint_t)written_frames); } return; }