Changeset eaee767 for src/synth


Ignore:
Timestamp:
Apr 21, 2016, 7:30:25 PM (9 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/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
ce3ff2b
Parents:
23493b5
Message:

src/synth/sampler.c: keeps a copy of uri

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/synth/sampler.c

    r23493b5 reaee767  
    5656}
    5757
    58 uint_t aubio_sampler_load( aubio_sampler_t * o, char_t * uri )
     58uint_t aubio_sampler_load( aubio_sampler_t * o, const char_t * uri )
    5959{
    6060  if (o->source) del_aubio_source(o->source);
    61   o->uri = uri;
     61
     62  if (s->uri) AUBIO_FREE(s->uri);
     63  s->uri = AUBIO_ARRAY(char_t, strnlen(uri, PATH_MAX));
     64  strncpy(s->uri, uri, strnlen(uri, PATH_MAX));
     65
    6266  o->source = new_aubio_source(uri, o->samplerate, o->blocksize);
    6367  if (o->source) return 0;
     
    6670}
    6771
    68 void aubio_sampler_do ( aubio_sampler_t * o, fvec_t * input, fvec_t * output)
     72void aubio_sampler_do ( aubio_sampler_t * o, const fvec_t * input, fvec_t * output)
    6973{
    7074  uint_t read = 0, i;
     
    8387}
    8488
    85 void aubio_sampler_do_multi ( aubio_sampler_t * o, fmat_t * input, fmat_t * output)
     89void aubio_sampler_do_multi ( aubio_sampler_t * o, const fmat_t * input, fmat_t * output)
    8690{
    8791  uint_t read = 0, i, j;
     
    104108}
    105109
    106 uint_t aubio_sampler_get_playing ( aubio_sampler_t * o )
     110uint_t aubio_sampler_get_playing ( const aubio_sampler_t * o )
    107111{
    108112  return o->playing;
     
    131135    del_aubio_source(o->source);
    132136  }
     137  if (s->uri) AUBIO_FREE(s->uri);
    133138  del_fvec(o->source_output);
    134139  del_fmat(o->source_output_multi);
Note: See TracChangeset for help on using the changeset viewer.