Changeset a006c5f
- Timestamp:
- Oct 10, 2016, 11:42:14 AM (8 years ago)
- Branches:
- sampler
- Children:
- 2ca4b59
- Parents:
- f253b03
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/synth/sampler.c
rf253b03 ra006c5f 45 45 } aubio_sampler_reading_method; 46 46 47 48 int check_wrote = 0;49 47 50 48 typedef enum { … … 149 147 s->threaded_read = 1; 150 148 #endif 149 150 if (s->source_blocksize < s->blocksize) { 151 s->source_blocksize = s->blocksize; 152 } 151 153 // FIXME: perfectloop fails if source_blocksize > 2048 with source_avcodec 152 154 //s->source_blocksize = 8192; … … 230 232 newsource = new_aubio_source(uri, o->samplerate, o->source_blocksize); 231 233 if (newsource) { 234 uint_t duration = aubio_source_get_duration(newsource); 235 if (duration < o->blocksize) { 236 AUBIO_WRN("sampler: %s is %d frames long, but blocksize is %d\n", 237 uri, duration, o->blocksize); 238 } 232 239 o->source = newsource; 233 240 if (oldsource) del_aubio_source(oldsource); … … 392 399 s->source_output = output; 393 400 *read = aubio_sampler_pull_from_source(s); 394 check_wrote += s->source_blocksize;395 401 if (*read < s->source_blocksize) { 396 402 //AUBIO_WRN("sampler: calling go_eof in _read_from_source()\n"); … … 443 449 //AUBIO_MSG("sampler: pulling %d / %d from ringbuffer\n", s->blocksize, ring_avail); 444 450 aubio_ringbuffer_pull(s->ring, output, s->blocksize); 445 check_wrote += s->blocksize;446 451 *read = s->blocksize; 447 452 if (s->eof_remaining > 0) { … … 454 459 } 455 460 } else { 456 AUBIO_MSG("sampler: last frame, pulling remaining %d left\n", ring_avail);461 //AUBIO_MSG("sampler: last frame, pulling remaining %d left\n", ring_avail); 457 462 *read = 0; 458 463 if (ring_avail > 0) { 459 464 // pull remaining frames in ring buffer 460 465 aubio_ringbuffer_pull(s->ring, output, ring_avail); 461 check_wrote += ring_avail;462 466 *read += ring_avail; 463 467 } … … 491 495 available = 0; 492 496 } else if (!s->finished) { 493 //AUBIO_ERR("sampler: _read_from_source: waiting for read avail %d\n", s->started);494 497 pthread_cond_signal(&s->read_request); 495 498 pthread_cond_wait(&s->read_avail, &s->read_mutex); … … 518 521 aubio_sampler_reading_from_source_ring_pull(s, output, read); 519 522 } 520 //*read = s->available;521 523 } 522 524 #endif … … 719 721 void del_aubio_sampler( aubio_sampler_t * o ) 720 722 { 721 AUBIO_MSG("sampler: check_wrote: %d\n", check_wrote);722 723 #ifdef HAVE_THREADS 723 724 // close opening thread
Note: See TracChangeset
for help on using the changeset viewer.