Changeset 0428150


Ignore:
Timestamp:
Dec 7, 2013, 7:11:09 PM (7 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
251da3b
Parents:
5958d1e
Message:

examples/parse_args.h: check buffer_size and hop_size

File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/parse_args.h

    r5958d1e r0428150  
    230230  }
    231231
     232  if (hop_size < 1) {
     233    errmsg("Error: got hop_size %d, but can not be < 1\n", hop_size);
     234    usage ( stderr, 1 );
     235  } else if (buffer_size < 2) {
     236    errmsg("Error: got buffer_size %d, but can not be < 2\n", buffer_size);
     237    usage ( stderr, 1 );
     238  } else if (buffer_size < hop_size + 1) {
     239    errmsg("Error: hop size (%d) is larger than or equal to win size (%d)\n",
     240        buffer_size, hop_size);
     241    usage ( stderr, 1 );
     242  }
     243
    232244  return 0;
    233245}
Note: See TracChangeset for help on using the changeset viewer.