Ignore:
Timestamp:
Dec 16, 2018, 7:17:26 PM (6 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/timestretch, fix/ffmpeg5, master
Children:
dea8506
Parents:
e406835
Message:

[io] clean up sink_wavwrite

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/io/sink_wavwrite.c

    re406835 r3e1c482  
    8888    goto beach;
    8989  }
    90   if ((sint_t)samplerate < 0) {
    91     AUBIO_ERR("sink_wavwrite: Can not create %s with samplerate %d\n", path, samplerate);
    92     goto beach;
    93   }
    94 
    95   if (s->path) AUBIO_FREE(s->path);
     90
    9691  s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX) + 1);
    9792  strncpy(s->path, path, strnlen(path, PATH_MAX) + 1);
     
    136131  s->samplerate = samplerate;
    137132  // automatically open when both samplerate and channels have been set
    138   if (s->samplerate != 0 && s->channels != 0) {
     133  if (/* s->samplerate != 0 && */ s->channels != 0) {
    139134    return aubio_sink_wavwrite_open(s);
    140135  }
     
    149144  s->channels = channels;
    150145  // automatically open when both samplerate and channels have been set
    151   if (s->samplerate != 0 && s->channels != 0) {
     146  if (s->samplerate != 0 /* && s->channels != 0 */) {
    152147    return aubio_sink_wavwrite_open(s);
    153148  }
     
    295290
    296291void del_aubio_sink_wavwrite(aubio_sink_wavwrite_t * s){
    297   if (!s) return;
    298   aubio_sink_wavwrite_close(s);
    299   if (s->path) AUBIO_FREE(s->path);
    300   AUBIO_FREE(s->scratch_data);
     292  AUBIO_ASSERT(s);
     293  if (s->fid)
     294    aubio_sink_wavwrite_close(s);
     295  if (s->path)
     296    AUBIO_FREE(s->path);
     297  if (s->scratch_data)
     298    AUBIO_FREE(s->scratch_data);
    301299  AUBIO_FREE(s);
    302300}
Note: See TracChangeset for help on using the changeset viewer.