From 776a5d338831c2dc82a5688a2ef940bbfed358f0 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Sun, 15 Jul 2012 18:48:03 -0600 Subject: [PATCH] src/io/sink_sndfile.c: ident and simplify --- src/io/sink_sndfile.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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; } -- 2.26.2