Changeset c0a1906


Ignore:
Timestamp:
Dec 17, 2018, 2:01:06 AM (5 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:
0512fca
Parents:
d16fbba
Message:

[source] simplify and avoid unrequired checks

Location:
src/io
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/io/source.c

    rd16fbba rc0a1906  
    139139
    140140void del_aubio_source(aubio_source_t * s) {
     141  AUBIO_ASSERT(s);
    141142  if (s->s_del && s->source)
    142143    s->s_del((void *)s->source);
  • src/io/source_apple_audio.c

    rd16fbba rc0a1906  
    9595  UInt32 propSize;
    9696
    97   if (s->path) AUBIO_FREE(s->path);
    9897  s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX) + 1);
    9998  strncpy(s->path, path, strnlen(path, PATH_MAX) + 1);
     
    294293
    295294void del_aubio_source_apple_audio(aubio_source_apple_audio_t * s){
     295  AUBIO_ASSERT(s);
    296296  aubio_source_apple_audio_close (s);
    297297  if (s->path) AUBIO_FREE(s->path);
    298298  freeAudioBufferList(&s->bufferList);
    299299  AUBIO_FREE(s);
    300   return;
    301300}
    302301
  • src/io/source_avcodec.c

    rd16fbba rc0a1906  
    148148  s->channels = 1;
    149149
    150   if (s->path) AUBIO_FREE(s->path);
    151150  s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX) + 1);
    152151  strncpy(s->path, path, strnlen(path, PATH_MAX) + 1);
     
    640639
    641640void del_aubio_source_avcodec(aubio_source_avcodec_t * s){
    642   if (!s) return;
     641  AUBIO_ASSERT(s);
    643642  aubio_source_avcodec_close(s);
    644643  if (s->output != NULL) {
  • src/io/source_sndfile.c

    rd16fbba rc0a1906  
    331331
    332332void del_aubio_source_sndfile(aubio_source_sndfile_t * s){
    333   if (!s) return;
     333  AUBIO_ASSERT(s);
    334334  aubio_source_sndfile_close(s);
    335335#ifdef HAVE_SAMPLERATE
  • src/io/source_wavread.c

    rd16fbba rc0a1906  
    9292  }
    9393
    94   if (s->path) AUBIO_FREE(s->path);
    9594  s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX) + 1);
    9695  strncpy(s->path, path, strnlen(path, PATH_MAX) + 1);
     
    472471
    473472void del_aubio_source_wavread(aubio_source_wavread_t * s) {
    474   if (!s) return;
     473  AUBIO_ASSERT(s);
    475474  aubio_source_wavread_close(s);
    476475  if (s->short_output) AUBIO_FREE(s->short_output);
Note: See TracChangeset for help on using the changeset viewer.