Ignore:
Timestamp:
Jan 26, 2014, 8:16:59 PM (10 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:
422452b
Parents:
082c88b
Message:

src/io/sink*: add _close function, improve error messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/io/sink_sndfile.c

    r082c88b ra9fd272  
    116116}
    117117
     118uint_t aubio_sink_sndfile_close (aubio_sink_sndfile_t *s) {
     119  if (!s->handle) {
     120    return AUBIO_FAIL;
     121  }
     122  if (sf_close(s->handle)) {
     123    AUBIO_ERR("Error closing file %s: %s", s->path, sf_strerror (NULL));
     124    return AUBIO_FAIL;
     125  }
     126  s->handle = NULL;
     127  return AUBIO_OK;
     128}
     129
    118130void del_aubio_sink_sndfile(aubio_sink_sndfile_t * s){
    119131  if (!s) return;
    120   if (sf_close(s->handle)) {
    121     AUBIO_ERR("Error closing file %s: %s", s->path, sf_strerror (NULL));
    122   }
     132  aubio_sink_sndfile_close(s);
    123133  AUBIO_FREE(s->scratch_data);
    124134  AUBIO_FREE(s);
Note: See TracChangeset for help on using the changeset viewer.