src/io/source_wavread.c: allow closing twice
authorPaul Brossier <piem@piem.org>
Mon, 27 Feb 2017 00:33:21 +0000 (01:33 +0100)
committerPaul Brossier <piem@piem.org>
Mon, 27 Feb 2017 00:33:21 +0000 (01:33 +0100)
src/io/source_wavread.c

index 4565b33..640201b 100644 (file)
@@ -439,8 +439,8 @@ uint_t aubio_source_wavread_get_duration (const aubio_source_wavread_t * s) {
 }
 
 uint_t aubio_source_wavread_close (aubio_source_wavread_t * s) {
-  if (!s->fid) {
-    return AUBIO_FAIL;
+  if (s->fid == NULL) {
+    return AUBIO_OK;
   }
   if (fclose(s->fid)) {
     AUBIO_ERR("source_wavread: could not close %s (%s)\n", s->path, strerror(errno));