Changeset 128589e


Ignore:
Timestamp:
Oct 9, 2016, 8:03:29 PM (8 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
sampler
Children:
f253b03
Parents:
fefbbd8
Message:

src/utils/ringbuffer.c: remove asserts, make sure request < available

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/utils/ringbuffer.c

    rfefbbd8 r128589e  
    4747    fvec_t tmp; tmp.data = o->buffer->data + o->write_pos; tmp.length = write;
    4848    fvec_t tmpin; tmpin.data = input->data; tmpin.length = write;
    49     assert(tmpin.length == tmp.length);
     49    //assert(tmpin.length == tmp.length);
    5050    fvec_copy(&tmpin, &tmp);
    5151
     
    7070      tmpin.data = input->data;
    7171      tmpin.length = remaining;
    72       assert(tmpin.length == tmp.length);
     72      //assert(tmpin.length == tmp.length);
    7373      fvec_copy(&tmpin, &tmp);
    7474    }
     
    7878    tmpin.data = input->data + remaining;
    7979    tmpin.length = write - remaining;
    80     assert(tmpin.length == tmp.length);
     80    //assert(tmpin.length == tmp.length);
    8181    fvec_copy(&tmpin, &tmp);
    8282    //AUBIO_WRN("ringbuffer: push2: changing write_pos from %d\n", o->write_pos);
     
    9494
    9595uint_t aubio_ringbuffer_pull(aubio_ringbuffer_t *o, fvec_t *output, uint_t request) {
    96   if (o->available <= 0) {
     96  if (o->available < (sint_t)request) {
    9797    AUBIO_ERR("ringbuffer: pull: requested %d but %d available\n",
    9898        request, o->available);
     
    113113    fvec_t tmp; tmp.data = o->buffer->data + o->read_pos; tmp.length = request;
    114114    fvec_t tmpout; tmpout.data = output->data; tmpout.length = request;
    115     assert(tmpout.length == tmp.length);
     115    //assert(tmpout.length == tmp.length);
    116116    fvec_copy(&tmp, &tmpout);
    117117    //AUBIO_WRN("ringbuffer: pull1: changing read_pos from %d\n", o->read_pos);
     
    131131    tmpout.data = output->data;
    132132    tmpout.length = remaining;
    133     assert(tmpout.length == tmp.length);
     133    //assert(tmpout.length == tmp.length);
    134134    fvec_copy(&tmpout, &tmp);
    135135    // write start
     
    138138    tmpout.data = output->data + remaining;
    139139    tmpout.length = request - remaining;
    140     assert(tmpout.length == tmp.length);
     140    //assert(tmpout.length == tmp.length);
    141141    fvec_copy(&tmp, &tmpout);
    142142    //AUBIO_WRN("ringbuffer: pull2: changing read_pos from %d\n", o->read_pos);
Note: See TracChangeset for help on using the changeset viewer.