Changeset 189c6ae for src


Ignore:
Timestamp:
Aug 7, 2018, 2:05:49 PM (16 months ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master
Children:
1f112cc
Parents:
4624a568 (diff), fb4ab89 (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.
Message:

Merge branch 'master' into dct

Location:
src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/io/source_avcodec.c

    r4624a568 r189c6ae  
    5959#include "source_avcodec.h"
    6060
     61#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(56, 56, 0)
    6162#define AUBIO_AVCODEC_MAX_BUFFER_SIZE FF_MIN_BUFFER_SIZE
     63#else
     64#define AUBIO_AVCODEC_MAX_BUFFER_SIZE AV_INPUT_BUFFER_MIN_SIZE
     65#endif
    6266
    6367struct _aubio_source_avcodec_t {
     
    271275  // default to mono output
    272276  aubio_source_avcodec_reset_resampler(s, 0);
     277
     278  if (s->avr == NULL) goto beach;
    273279
    274280  s->eof = 0;
     
    419425    goto beach;
    420426  }
     427
     428#if LIBAVUTIL_VERSION_MAJOR > 52
     429  if (avFrame->channels != (sint_t)s->input_channels) {
     430    AUBIO_WRN ("source_avcodec: trying to read from %d channel(s),"
     431        "but configured for %d; is '%s' corrupt?\n", avFrame->channels,
     432        s->input_channels, s->path);
     433    goto beach;
     434  }
     435#endif
    421436
    422437#ifdef HAVE_AVRESAMPLE
  • src/io/source_wavread.c

    r4624a568 r189c6ae  
    190190  bytes_read += fread(buf, 1, 2, s->fid);
    191191  bitspersample = read_little_endian(buf, 2);
     192
     193  if ( channels == 0 ) {
     194    AUBIO_ERR("source_wavread: Failed opening %s (number of channels can not be 0)\n", s->path);
     195    goto beach;
     196  }
     197
     198  if ( (sint_t)sr <= 0 ) {
     199    AUBIO_ERR("source_wavread: Failed opening %s (samplerate can not be <= 0)\n", s->path);
     200    goto beach;
     201  }
     202
     203  if ( byterate == 0 ) {
     204    AUBIO_ERR("source_wavread: Failed opening %s (byterate can not be 0)\n", s->path);
     205    goto beach;
     206  }
     207
     208  if ( bitspersample == 0 ) {
     209    AUBIO_ERR("source_wavread: Failed opening %s (bitspersample can not be 0)\n", s->path);
     210    goto beach;
     211  }
    192212#if 0
    193213  if ( bitspersample != 16 ) {
  • src/notes/notes.c

    r4624a568 r189c6ae  
    8484
    8585  o->pitch = new_aubio_pitch (pitch_method, o->pitch_buf_size, o->hop_size, o->samplerate);
     86  if (o->pitch == NULL) goto fail;
    8687  if (o->pitch_tolerance != 0.) aubio_pitch_set_tolerance (o->pitch, o->pitch_tolerance);
    8788  aubio_pitch_set_unit (o->pitch, "midi");
  • src/onset/onset.c

    r4624a568 r189c6ae  
    308308    o->apply_compression = 0;
    309309    aubio_onset_set_awhitening (o, 0);
     310  } else if (strcmp (onset_mode, "wphase") == 0) {
     311    // use defaults for now
    310312  } else if (strcmp (onset_mode, "mkl") == 0) {
    311313    aubio_onset_set_threshold (o, 0.05);
  • src/pitch/pitchyinfft.c

    r4624a568 r189c6ae  
    4545   160.,   200.,   250.,   315.,   400.,   500.,   630.,   800.,  1000.,  1250.,
    4646  1600.,  2000.,  2500.,  3150.,  4000.,  5000.,  6300.,  8000.,  9000., 10000.,
    47  12500., 15000., 20000., 25100
     47 12500., 15000., 20000., 25100., -1.
    4848};
    4949
     
    7373  for (i = 0; i < p->weight->length; i++) {
    7474    freq = (smpl_t) i / (smpl_t) bufsize *(smpl_t) samplerate;
    75     while (freq > freqs[j]) {
     75    while (freq > freqs[j] && freqs[j] > 0) {
     76      //AUBIO_DBG("freq %3.5f > %3.5f \tsamplerate %d (Hz) \t"
     77      //    "(weight length %d, bufsize %d) %d %d\n", freq, freqs[j],
     78      //    samplerate, p->weight->length, bufsize, i, j);
    7679      j += 1;
    7780    }
Note: See TracChangeset for help on using the changeset viewer.