Changeset 41b985f for src/io/source_wavread.c
- Timestamp:
- Mar 12, 2017, 11:26:24 AM (7 years ago)
- Branches:
- sampler
- Children:
- bde49c4a
- Parents:
- 71f2e5f (diff), 67b6618 (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
r71f2e5f r41b985f 19 19 */ 20 20 21 #include " config.h"21 #include "aubio_priv.h" 22 22 23 23 #ifdef HAVE_WAVREAD 24 24 25 #include "aubio_priv.h"26 25 #include "fvec.h" 27 26 #include "fmat.h" … … 330 329 uint_t end = 0; 331 330 uint_t total_wrote = 0; 331 if (s->fid == NULL) { 332 AUBIO_ERR("source_wavread: could not read from %s (file not opened)\n", 333 s->path); 334 return; 335 } 332 336 while (total_wrote < s->hop_size) { 333 337 end = MIN(s->read_samples - s->read_index, s->hop_size - total_wrote); … … 364 368 uint_t end = 0; 365 369 uint_t total_wrote = 0; 370 if (s->fid == NULL) { 371 AUBIO_ERR("source_wavread: could not read from %s (file not opened)\n", 372 s->path); 373 return; 374 } 366 375 while (total_wrote < s->hop_size) { 367 376 end = MIN(s->read_samples - s->read_index, s->hop_size - total_wrote); … … 404 413 uint_t aubio_source_wavread_seek (aubio_source_wavread_t * s, uint_t pos) { 405 414 uint_t ret = 0; 415 if (s->fid == NULL) { 416 AUBIO_ERR("source_wavread: could not seek %s (file not opened?)\n", s->path, pos); 417 return AUBIO_FAIL; 418 } 406 419 if ((sint_t)pos < 0) { 420 AUBIO_ERR("source_wavread: could not seek %s at %d (seeking position should be >= 0)\n", s->path, pos); 407 421 return AUBIO_FAIL; 408 422 } … … 426 440 427 441 uint_t aubio_source_wavread_close (aubio_source_wavread_t * s) { 428 if ( !s->fid) {429 return AUBIO_ FAIL;442 if (s->fid == NULL) { 443 return AUBIO_OK; 430 444 } 431 445 if (fclose(s->fid)) {
Note: See TracChangeset
for help on using the changeset viewer.