Changeset 43ea60d


Ignore:
Timestamp:
Dec 19, 2018, 2:53:18 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:
ee463f9
Parents:
387b605
Message:

[tests] improve test-sink variable names

Location:
tests/src/io
Files:
2 edited

Legend:

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

    r387b605 r43ea60d  
    2626  char_t *sink_path = argv[2];
    2727
    28   aubio_source_t *i = NULL;
    29   aubio_sink_custom_t *o = NULL;
     28  aubio_source_t *src = NULL;
     29  aubio_sink_custom_t *snk = NULL;
    3030
    3131  if ( argc >= 4 ) samplerate = atoi(argv[3]);
     
    3535  if (!vec) { err = 1; goto failure; }
    3636
    37   i = new_aubio_source(source_path, samplerate, hop_size);
    38   if (!i) { err = 1; goto failure; }
    39   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);
    4040
    41   o = new_aubio_sink_custom(sink_path, samplerate);
    42   if (!o) { err = 1; goto failure; }
     41  snk = new_aubio_sink_custom(sink_path, samplerate);
     42  if (!snk) { err = 1; goto failure; }
    4343
    4444  do {
    45     aubio_source_do(i, vec, &read);
    46     aubio_sink_custom_do(o, vec, read);
     45    aubio_source_do(src, vec, &read);
     46    aubio_sink_custom_do(snk, vec, read);
    4747    n_frames += read;
    4848  } while ( read == hop_size );
     
    5353
    5454  // close sink now (optional)
    55   aubio_sink_custom_close(o);
     55  aubio_sink_custom_close(snk);
    5656
    5757failure:
    58   if (o)
    59     del_aubio_sink_custom(o);
    60   if (i)
    61     del_aubio_source(i);
     58  if (snk)
     59    del_aubio_sink_custom(snk);
     60  if (src)
     61    del_aubio_source(src);
    6262  if (vec)
    6363    del_fvec(vec);
  • tests/src/io/test-sink.c

    r387b605 r43ea60d  
    2222  char_t *sink_path = argv[2];
    2323
    24   aubio_source_t *i = NULL;
    25   aubio_sink_t *o = NULL;
     24  aubio_source_t *src = NULL;
     25  aubio_sink_t *snk = NULL;
    2626
    2727  if ( argc >= 4 ) samplerate = atoi(argv[3]);
     
    3131  if (!vec) { err = 1; goto failure; }
    3232
    33   i = new_aubio_source(source_path, samplerate, hop_size);
    34   if (!i) { err = 1; goto failure; }
    35   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);
    3636
    37   o = new_aubio_sink(sink_path, samplerate);
    38   if (!o) { err = 1; goto failure; }
     37  snk = new_aubio_sink(sink_path, samplerate);
     38  if (!snk) { err = 1; goto failure; }
    3939
    4040  do {
    41     aubio_source_do(i, vec, &read);
    42     aubio_sink_do(o, vec, read);
     41    aubio_source_do(src, vec, &read);
     42    aubio_sink_do(snk, vec, read);
    4343    n_frames += read;
    4444  } while ( read == hop_size );
     
    4949
    5050  // close sink now (optional)
    51   aubio_sink_close(o);
     51  aubio_sink_close(snk);
    5252
    5353failure:
    54   if (o)
    55     del_aubio_sink(o);
    56   if (i)
    57     del_aubio_source(i);
     54  if (snk)
     55    del_aubio_sink(snk);
     56  if (src)
     57    del_aubio_source(src);
    5858  if (vec)
    5959    del_fvec(vec);
Note: See TracChangeset for help on using the changeset viewer.