Ignore:
Timestamp:
Dec 19, 2018, 9:49:26 PM (5 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/crepe, fix/ffmpeg5, master
Children:
5573a6b, 5e9bdca
Parents:
0e6ad10 (diff), 0045668 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into feature/sink_vorbis

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/src/io/base-sink_custom.h

    r0e6ad10 rf5adffe  
    2626  char_t *sink_path = argv[2];
    2727
     28  aubio_source_t *src = NULL;
     29  aubio_sink_custom_t *snk = NULL;
     30
    2831  if ( argc >= 4 ) samplerate = atoi(argv[3]);
    2932  if ( argc >= 5 ) hop_size = atoi(argv[4]);
    3033
    3134  fvec_t *vec = new_fvec(hop_size);
     35  if (!vec) { err = 1; goto failure; }
    3236
    33   aubio_source_t *i = new_aubio_source(source_path, samplerate, hop_size);
    34   if (samplerate == 0 ) samplerate = aubio_source_get_samplerate(i);
     37  src = new_aubio_source(source_path, samplerate, hop_size);
     38  if (!src) { err = 1; goto failure; }
     39  if (samplerate == 0 ) samplerate = aubio_source_get_samplerate(src);
    3540
    36   aubio_sink_custom_t *o = new_aubio_sink_custom(sink_path, samplerate);
    37 
    38   if (!vec || !i || !o) { err = 1; goto failure; }
     41  snk = new_aubio_sink_custom(sink_path, samplerate);
     42  if (!snk) { err = 1; goto failure; }
    3943
    4044  do {
    41     aubio_source_do(i, vec, &read);
    42     aubio_sink_custom_do(o, vec, read);
     45    aubio_source_do(src, vec, &read);
     46    aubio_sink_custom_do(snk, vec, read);
    4347    n_frames += read;
    4448  } while ( read == hop_size );
     
    4953
    5054  // close sink now (optional)
    51   aubio_sink_custom_close(o);
     55  aubio_sink_custom_close(snk);
    5256
    5357failure:
    54   if (o)
    55     del_aubio_sink_custom(o);
    56   if (i)
    57     del_aubio_source(i);
     58  if (snk)
     59    del_aubio_sink_custom(snk);
     60  if (src)
     61    del_aubio_source(src);
    5862  if (vec)
    5963    del_fvec(vec);
Note: See TracChangeset for help on using the changeset viewer.