Ignore:
Timestamp:
Aug 12, 2015, 7:21:38 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:
60fc05b
Parents:
3a1a5d6 (diff), 7b2d740 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'develop' into notes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/io/source_wavread.c

    r3a1a5d6 rb257b60  
    9393  s->fid = fopen((const char *)path, "rb");
    9494  if (!s->fid) {
    95     AUBIO_ERR("source_wavread: could not open %s (%s)\n", s->path, strerror(errno));
     95    AUBIO_ERR("source_wavread: Failed opening %s (System error: %s)\n", s->path, strerror(errno));
    9696    goto beach;
    9797  }
     
    220220#ifndef HAVE_WIN_HACKS
    221221    AUBIO_ERR("source_wavread: short read (%zd instead of %zd) in %s\n",
     222        bytes_read, bytes_expected, s->path);
    222223#else // mingw does not know about %zd...
    223224    AUBIO_ERR("source_wavread: short read (%d instead of %d) in %s\n",
     225        (int)bytes_read, (int)bytes_expected, s->path);
    224226#endif
    225         bytes_read, bytes_expected, s->path);
    226227    goto beach;
    227228  }
     
    356357
    357358uint_t aubio_source_wavread_seek (aubio_source_wavread_t * s, uint_t pos) {
    358   uint_t ret = fseek(s->fid, s->seek_start + pos * s->blockalign, SEEK_SET);
     359  uint_t ret = 0;
     360  if ((sint_t)pos < 0) {
     361    return AUBIO_FAIL;
     362  }
     363  ret = fseek(s->fid, s->seek_start + pos * s->blockalign, SEEK_SET);
     364  if (ret != 0) {
     365    AUBIO_ERR("source_wavread: could not seek %s at %d (%s)\n", s->path, pos, strerror(errno));
     366    return AUBIO_FAIL;
     367  }
     368  // reset some values
    359369  s->eof = 0;
    360370  s->read_index = 0;
    361   return ret;
     371  return AUBIO_OK;
    362372}
    363373
Note: See TracChangeset for help on using the changeset viewer.