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/test-sink.c

    r0e6ad10 rf5adffe  
    2222  char_t *sink_path = argv[2];
    2323
     24  aubio_source_t *src = NULL;
     25  aubio_sink_t *snk = NULL;
     26
    2427  if ( argc >= 4 ) samplerate = atoi(argv[3]);
    2528  if ( argc >= 5 ) hop_size = atoi(argv[4]);
    2629
    2730  fvec_t *vec = new_fvec(hop_size);
     31  if (!vec) { err = 1; goto failure; }
    2832
    29   aubio_source_t *i = new_aubio_source(source_path, samplerate, hop_size);
    30   if (samplerate == 0 ) samplerate = aubio_source_get_samplerate(i);
     33  src = new_aubio_source(source_path, samplerate, hop_size);
     34  if (!src) { err = 1; goto failure; }
     35  if (samplerate == 0 ) samplerate = aubio_source_get_samplerate(src);
    3136
    32   aubio_sink_t *o = new_aubio_sink(sink_path, samplerate);
    33 
    34   if (!vec || !i || !o) { err = 1; goto failure; }
     37  snk = new_aubio_sink(sink_path, samplerate);
     38  if (!snk) { err = 1; goto failure; }
    3539
    3640  do {
    37     aubio_source_do(i, vec, &read);
    38     aubio_sink_do(o, vec, read);
     41    aubio_source_do(src, vec, &read);
     42    aubio_sink_do(snk, vec, read);
    3943    n_frames += read;
    4044  } while ( read == hop_size );
     
    4549
    4650  // close sink now (optional)
    47   aubio_sink_close(o);
     51  aubio_sink_close(snk);
    4852
    4953failure:
    50   if (o)
    51     del_aubio_sink(o);
    52   if (i)
    53     del_aubio_source(i);
     54  if (snk)
     55    del_aubio_sink(snk);
     56  if (src)
     57    del_aubio_source(src);
    5458  if (vec)
    5559    del_fvec(vec);
Note: See TracChangeset for help on using the changeset viewer.