Changeset b257b60 for src/io/source_wavread.c
- Timestamp:
- Aug 12, 2015, 7:21:38 PM (9 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/io/source_wavread.c
r3a1a5d6 rb257b60 93 93 s->fid = fopen((const char *)path, "rb"); 94 94 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)); 96 96 goto beach; 97 97 } … … 220 220 #ifndef HAVE_WIN_HACKS 221 221 AUBIO_ERR("source_wavread: short read (%zd instead of %zd) in %s\n", 222 bytes_read, bytes_expected, s->path); 222 223 #else // mingw does not know about %zd... 223 224 AUBIO_ERR("source_wavread: short read (%d instead of %d) in %s\n", 225 (int)bytes_read, (int)bytes_expected, s->path); 224 226 #endif 225 bytes_read, bytes_expected, s->path);226 227 goto beach; 227 228 } … … 356 357 357 358 uint_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 359 369 s->eof = 0; 360 370 s->read_index = 0; 361 return ret;371 return AUBIO_OK; 362 372 } 363 373
Note: See TracChangeset
for help on using the changeset viewer.