Changeset 5958d1e


Ignore:
Timestamp:
Dec 7, 2013, 7:10:52 PM (10 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:
0428150
Parents:
21e2e6db
Message:

src/spectral/phasevoc.c: check win_s and hop_s

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/spectral/phasevoc.c

    r21e2e6db r5958d1e  
    7676
    7777  if (hop_s < 1) {
    78     AUBIO_ERR("Hop size is smaller than 1!\n");
    79     AUBIO_ERR("Resetting hop size to half the window size.\n");
    80     hop_s = win_s / 2;
     78    AUBIO_ERR("got hop_size %d, but can not be < 1\n", hop_s);
     79    goto beach;
     80  } else if (win_s < 1) {
     81    AUBIO_ERR("got buffer_size %d, but can not be < 2\n", win_s);
     82    goto beach;
     83  } else if (win_s < hop_s + 1) {
     84    AUBIO_ERR("hop size (%d) is larger than or equal to win size (%d)\n", win_s, hop_s);
     85    goto beach;
    8186  }
    8287
     
    96101
    97102  return pv;
     103
     104beach:
     105  AUBIO_FREE (pv);
     106  return NULL;
    98107}
    99108
Note: See TracChangeset for help on using the changeset viewer.