Changeset f8bdcb2


Ignore:
Timestamp:
Mar 17, 2017, 6:23:17 PM (3 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
sampler
Children:
f651625
Parents:
bad88364
Message:

src/synth/sampler.c: also compile without pthread

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/synth/sampler.c

    rbad88364 rf8bdcb2  
    7777  // time stretching
    7878  aubio_timestretch_t *ts;
     79  sint_t available;             // number of samples currently available
     80  uint_t started;               // source warmed up
     81  // source
     82  uint_t source_blocksize;
     83  uint_t channels;
     84  fvec_t *source_output;
     85  fmat_t *source_moutput;
     86  //fvec_t *source_output_tmp;
     87  //uint_t last_read;
     88  uint_t threaded_read;         // use reading thread?
    7989#ifdef HAVE_THREADS
    8090  // file reading thread
    8191  pthread_t read_thread;
    82   uint_t threaded_read;         // use reading thread?
    8392  pthread_mutex_t read_mutex;
    8493  pthread_cond_t read_avail;
    8594  pthread_cond_t read_request;
    86   uint_t source_blocksize;
    87   fvec_t *source_output;
    88   fvec_t *source_output_tmp;
    89   uint_t last_read;
    90   fmat_t *source_moutput;
    91   uint_t channels;
    9295  // file opening thread
    9396  pthread_t open_thread;
     
    9699  char_t *next_uri;
    97100  uint_t open_thread_running;
    98   sint_t available;             // number of samples currently available
    99   uint_t started;               // source warmed up
    100101  uint_t read_thread_finish;    // flag to tell reading thread to exit
    101102#endif
     
    137138  s->available = 0;
    138139
    139   s->threaded_read = 0;
    140140  s->perfectloop = 0;
    141141#if 0 // naive mode
     
    150150  s->source_blocksize = 2048; //32 * s->blocksize;
    151151  s->perfectloop = 1;
     152#endif
     153
     154#ifdef HAVE_THREADS
     155  // disabled for now
    152156  s->threaded_read = 0;
    153 #endif
     157#else
     158  s->threaded_read = 0;
     159#endif
     160
     161  s->perfectloop = 1;
    154162
    155163  if (s->source_blocksize < s->blocksize) {
     
    186194
    187195  s->ts = new_aubio_timestretch("default", 1., s->blocksize, s->samplerate);
    188   s->source_output_tmp = new_fvec(s->source_blocksize);
    189   s->last_read = 0;
     196  //s->source_output_tmp = new_fvec(s->source_blocksize);
     197  //s->last_read = 0;
    190198
    191199  return s;
     
    272280    ret = AUBIO_OK;
    273281    AUBIO_MSG("sampler: loaded %s\n", uri);
     282#ifdef HAVE_THREADS
    274283    if (o->waited) {
    275284      AUBIO_WRN("sampler: %.2fms (%d samples) taken to load %s\n", 1000. *
    276285          o->waited / (smpl_t)o->samplerate, o->waited, o->uri);
    277286    }
     287#endif
    278288  } else {
    279289    o->source = NULL;
     
    819829
    820830uint_t
     831#ifdef HAVE_THREADS
    821832aubio_sampler_get_waited_opening (aubio_sampler_t *o, uint_t waited) {
    822 #ifdef HAVE_THREADS
    823833  if (o->playing) {
    824834    if (!o->opened) {
     
    832842    }
    833843  }
     844#else
     845aubio_sampler_get_waited_opening (aubio_sampler_t *o UNUSED, uint_t waited UNUSED) {
    834846#endif
    835847  return 0;
     
    849861    ret = AUBIO_OK;
    850862  }
    851   o->last_read = 0;
     863  //o->last_read = 0;
    852864  return ret;
    853865}
Note: See TracChangeset for help on using the changeset viewer.