From: Paul Brossier Date: Sun, 26 Feb 2017 22:35:04 +0000 (+0100) Subject: src/io/source_sndfile.c: call sf_seek after checking for s->handle X-Git-Tag: 0.4.5~96 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=53bb4da5d8af1bf85d8af529eb3c37c025c29d5d;p=aubio.git src/io/source_sndfile.c: call sf_seek after checking for s->handle --- diff --git a/src/io/source_sndfile.c b/src/io/source_sndfile.c index 5d009c57..76735936 100644 --- a/src/io/source_sndfile.c +++ b/src/io/source_sndfile.c @@ -294,12 +294,13 @@ uint_t aubio_source_sndfile_get_duration (const aubio_source_sndfile_t * s) { uint_t aubio_source_sndfile_seek (aubio_source_sndfile_t * s, uint_t pos) { uint_t resampled_pos = (uint_t)ROUND(pos / s->ratio); - sf_count_t sf_ret = sf_seek (s->handle, resampled_pos, SEEK_SET); + sf_count_t sf_ret; if (s->handle == NULL) { AUBIO_ERR("source_sndfile: failed seeking in %s (file not opened?)\n", s->path); return AUBIO_FAIL; } + sf_ret = sf_seek (s->handle, resampled_pos, SEEK_SET); if (sf_ret == -1) { AUBIO_ERR("source_sndfile: Failed seeking %s at %d: %s\n", s->path, pos, sf_strerror (NULL)); return AUBIO_FAIL;