Changeset 491e6ea


Ignore:
Timestamp:
Jan 26, 2014, 9:18:22 PM (11 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/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
2e17371
Parents:
c038740
Message:

src/io/: add missing error strings prefixes

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/io/sink_sndfile.c

    rc038740 r491e6ea  
    5050
    5151  if (path == NULL) {
    52     AUBIO_ERR("Aborted opening null path\n");
     52    AUBIO_ERR("sink_sndfile: Aborted opening null path\n");
    5353    return NULL;
    5454  }
     
    7070  if (s->handle == NULL) {
    7171    /* show libsndfile err msg */
    72     AUBIO_ERR("Failed opening %s. %s\n", s->path, sf_strerror (NULL));
     72    AUBIO_ERR("sink_sndfile: Failed opening %s. %s\n", s->path, sf_strerror (NULL));
    7373    AUBIO_FREE(s);
    7474    return NULL;
     
    7878  /* allocate data for de/interleaving reallocated when needed. */
    7979  if (s->scratch_size >= MAX_SIZE * MAX_CHANNELS) {
    80     AUBIO_ERR("%d x %d exceeds maximum aubio_sink_sndfile buffer size %d\n",
     80    AUBIO_ERR("sink_sndfile: %d x %d exceeds maximum aubio_sink_sndfile buffer size %d\n",
    8181        s->max_size, s->channels, MAX_CHANNELS * MAX_CHANNELS);
    8282    AUBIO_FREE(s);
     
    110110  written_frames = sf_write_float (s->handle, s->scratch_data, nsamples);
    111111  if (written_frames/channels != write) {
    112     AUBIO_WRN("trying to write %d frames to %s, but only %d could be written",
     112    AUBIO_WRN("sink_sndfile: trying to write %d frames to %s, but only %d could be written",
    113113      write, s->path, (uint_t)written_frames);
    114114  }
     
    121121  }
    122122  if (sf_close(s->handle)) {
    123     AUBIO_ERR("Error closing file %s: %s", s->path, sf_strerror (NULL));
     123    AUBIO_ERR("sink_sndfile: Error closing file %s: %s", s->path, sf_strerror (NULL));
    124124    return AUBIO_FAIL;
    125125  }
  • src/io/source_avcodec.c

    rc038740 r491e6ea  
    6868  int err;
    6969  if (path == NULL) {
    70     AUBIO_ERR("Aborted opening null path\n");
     70    AUBIO_ERR("source_avcodec: Aborted opening null path\n");
    7171    goto beach;
    7272  }
    7373  if ((sint_t)samplerate < 0) {
    74     AUBIO_ERR("Can not open %s with samplerate %d\n", path, samplerate);
     74    AUBIO_ERR("source_avcodec: Can not open %s with samplerate %d\n", path, samplerate);
    7575    goto beach;
    7676  }
    7777  if ((sint_t)hop_size <= 0) {
    78     AUBIO_ERR("Can not open %s with hop_size %d\n", path, hop_size);
     78    AUBIO_ERR("source_avcodec: Can not open %s with hop_size %d\n", path, hop_size);
    7979    goto beach;
    8080  }
     
    9696    char errorstr[256];
    9797    av_strerror (err, errorstr, sizeof(errorstr));
    98     AUBIO_ERR("Failed opening %s (%s)\n", s->path, errorstr);
     98    AUBIO_ERR("source_avcodec: Failed opening %s (%s)\n", s->path, errorstr);
    9999    goto beach;
    100100  }
     
    107107    char errorstr[256];
    108108    av_strerror (err, errorstr, sizeof(errorstr));
    109     AUBIO_ERR("Could not find stream information " "for %s (%s)\n", s->path,
     109    AUBIO_ERR("source_avcodec: Could not find stream information " "for %s (%s)\n", s->path,
    110110        errorstr);
    111111    goto beach;
     
    123123        selected_stream = i;
    124124      } else {
    125         AUBIO_WRN("More than one audio stream in %s, "
     125        AUBIO_WRN("source_avcodec: More than one audio stream in %s, "
    126126            "taking the first one\n", s->path);
    127127      }
     
    129129  }
    130130  if (selected_stream == -1) {
    131     AUBIO_ERR("No audio stream in %s\n", s->path);
     131    AUBIO_ERR("source_avcodec: No audio stream in %s\n", s->path);
    132132    goto beach;
    133133  }
     
    139139  AVCodec *codec = avcodec_find_decoder(avCodecCtx->codec_id);
    140140  if (codec == NULL) {
    141     AUBIO_ERR("Could not find decoder for %s", s->path);
     141    AUBIO_ERR("source_avcodec: Could not find decoder for %s", s->path);
    142142    goto beach;
    143143  }
     
    146146    char errorstr[256];
    147147    av_strerror (err, errorstr, sizeof(errorstr));
    148     AUBIO_ERR("Could not load codec for %s (%s)\n", s->path, errorstr);
     148    AUBIO_ERR("source_avcodec: Could not load codec for %s (%s)\n", s->path, errorstr);
    149149    goto beach;
    150150  }
     
    163163
    164164  if (s->samplerate >  s->input_samplerate) {
    165     AUBIO_WRN("upsampling %s from %d to %d\n", s->path,
     165    AUBIO_WRN("source_avcodec: upsampling %s from %d to %d\n", s->path,
    166166        s->input_samplerate, s->samplerate);
    167167  }
     
    170170  avFrame = avcodec_alloc_frame();
    171171  if (!avFrame) {
    172     AUBIO_ERR("Could not allocate frame for (%s)\n", s->path);
     172    AUBIO_ERR("source_avcodec: Could not allocate frame for (%s)\n", s->path);
    173173  }
    174174
     
    223223      char errorstr[256];
    224224      av_strerror (err, errorstr, sizeof(errorstr));
    225       AUBIO_ERR("Could not open AVAudioResampleContext for %s (%s)\n",
     225      AUBIO_ERR("source_avcodec: Could not open AVAudioResampleContext for %s (%s)\n",
    226226          s->path, errorstr);
    227227      //goto beach;
  • src/io/source_sndfile.c

    rc038740 r491e6ea  
    6767
    6868  if (path == NULL) {
    69     AUBIO_ERR("Aborted opening null path\n");
     69    AUBIO_ERR("source_sndfile: Aborted opening null path\n");
    7070    goto beach;
    7171  }
    7272  if ((sint_t)samplerate < 0) {
    73     AUBIO_ERR("Can not open %s with samplerate %d\n", path, samplerate);
     73    AUBIO_ERR("source_sndfile: Can not open %s with samplerate %d\n", path, samplerate);
    7474    goto beach;
    7575  }
    7676  if ((sint_t)hop_size <= 0) {
    77     AUBIO_ERR("Can not open %s with hop_size %d\n", path, hop_size);
     77    AUBIO_ERR("source_sndfile: Can not open %s with hop_size %d\n", path, hop_size);
    7878    goto beach;
    7979  }
     
    8989  if (s->handle == NULL) {
    9090    /* show libsndfile err msg */
    91     AUBIO_ERR("Failed opening %s: %s\n", s->path, sf_strerror (NULL));
     91    AUBIO_ERR("source_sndfile: Failed opening %s: %s\n", s->path, sf_strerror (NULL));
    9292    goto beach;
    9393  }     
     
    108108
    109109  if (s->input_hop_size * s->input_channels > MAX_SAMPLES) {
    110     AUBIO_ERR("Not able to process more than %d frames of %d channels\n",
     110    AUBIO_ERR("source_sndfile: Not able to process more than %d frames of %d channels\n",
    111111        MAX_SAMPLES / s->input_channels, s->input_channels);
    112112    goto beach;
     
    122122      // we would need to add a ring buffer for these
    123123      if ( (uint_t)(s->input_hop_size * s->ratio + .5)  != s->hop_size ) {
    124         AUBIO_ERR("can not upsample %s from %d to %d\n", s->path,
     124        AUBIO_ERR("source_sndfile: can not upsample %s from %d to %d\n", s->path,
    125125            s->input_samplerate, s->samplerate);
    126126        goto beach;
    127127      }
    128       AUBIO_WRN("upsampling %s from %d to %d\n", s->path,
     128      AUBIO_WRN("source_sndfile: upsampling %s from %d to %d\n", s->path,
    129129          s->input_samplerate, s->samplerate);
    130130    }
     
    132132#else
    133133  if (s->ratio != 1) {
    134     AUBIO_ERR("aubio was compiled without aubio_resampler\n");
     134    AUBIO_ERR("source_sndfile: aubio was compiled without aubio_resampler\n");
    135135    goto beach;
    136136  }
     
    273273  }
    274274  if(sf_close(s->handle)) {
    275     AUBIO_ERR("Error closing file %s: %s", s->path, sf_strerror (NULL));
     275    AUBIO_ERR("source_sndfile: Error closing file %s: %s", s->path, sf_strerror (NULL));
    276276    return AUBIO_FAIL;
    277277  }
  • tests/src/test-cvec.c

    rc038740 r491e6ea  
    55{
    66  uint_t i, window_size = 16; // window size
    7   utils_init_random();
    87  cvec_t * complex_vector = new_cvec (window_size); // input buffer
    98  uint_t rand_times = 4;
     9
     10  utils_init_random();
    1011
    1112  while (rand_times -- ) {
Note: See TracChangeset for help on using the changeset viewer.