Changeset 0a1ad90 for src


Ignore:
Timestamp:
Dec 23, 2018, 12:11:17 AM (6 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/timestretch, fix/ffmpeg5, master
Children:
b40c149
Parents:
b03f1bf
Message:

[source_wavread] use STRERR macro

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/io/source_wavread.c

    rb03f1bf r0a1ad90  
    2727#include "ioutils.h"
    2828#include "source_wavread.h"
    29 
    30 #include <errno.h>
    3129
    3230#define AUBIO_WAVREAD_BUFSIZE 1024
     
    10199  s->fid = fopen((const char *)path, "rb");
    102100  if (!s->fid) {
    103     AUBIO_ERR("source_wavread: Failed opening %s (System error: %s)\n", s->path, strerror(errno));
     101    AUBIO_STRERR("source_wavread: Failed opening %s (%s)\n", s->path, errorstr);
    104102    goto beach;
    105103  }
     
    134132    bytes_junk += read_little_endian(buf, 4);
    135133    if (fseek(s->fid, bytes_read + bytes_junk, SEEK_SET) != 0) {
    136       AUBIO_ERR("source_wavread: Failed opening %s (could not seek past JUNK Chunk: %s)\n",
    137           s->path, strerror(errno));
     134      AUBIO_STRERR("source_wavread: Failed opening %s (could not seek past JUNK Chunk: %s)\n",
     135          s->path, errorstr);
    138136      goto beach;
    139137    }
     
    262260    bytes_junk += read_little_endian(buf, 4);
    263261    if (fseek(s->fid, bytes_read + bytes_junk, SEEK_SET) != 0) {
    264       AUBIO_ERR("source_wavread: could not seek past unknown chunk in %s (%s)\n",
    265           s->path, strerror(errno));
     262      AUBIO_STRERR("source_wavread: could not seek past unknown chunk in %s (%s)\n",
     263          s->path, errorstr);
    266264      goto beach;
    267265    }
     
    443441  ret = fseek(s->fid, s->seek_start + pos * s->blockalign, SEEK_SET);
    444442  if (ret != 0) {
    445     AUBIO_ERR("source_wavread: could not seek %s at %d (%s)\n", s->path, pos, strerror(errno));
     443    AUBIO_STRERR("source_wavread: could not seek %s at %d (%s)\n", s->path, pos, errorstr);
    446444    return AUBIO_FAIL;
    447445  }
     
    464462  }
    465463  if (fclose(s->fid)) {
    466     AUBIO_ERR("source_wavread: could not close %s (%s)\n", s->path, strerror(errno));
     464    AUBIO_STRERR("source_wavread: could not close %s (%s)\n", s->path, errorstr);
    467465    return AUBIO_FAIL;
    468466  }
Note: See TracChangeset for help on using the changeset viewer.