Changeset 0a7f424 for examples


Ignore:
Timestamp:
Dec 8, 2013, 5:11:48 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:
2c31bb6
Parents:
664fd25
Message:

examples/parse_args.h: make sure samplerate and sizes params are positive, fix help message

File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/parse_args.h

    r664fd25 r0a7f424  
    8181#ifdef PROG_HAS_OUTPUT
    8282      "       -m      --mix-input        mix input signal with output signal\n"
    83       "       -f      --force-overwrite  overwrite output file if\n"
     83      "       -f      --force-overwrite  overwrite output file if needed\n"
    8484#endif
    8585#ifdef PROG_HAS_JACK
     
    235235  }
    236236
    237   if (hop_size < 1) {
     237  if ((sint_t)hop_size < 1) {
    238238    errmsg("Error: got hop_size %d, but can not be < 1\n", hop_size);
    239239    usage ( stderr, 1 );
    240   } else if (buffer_size < 2) {
     240  } else if ((sint_t)buffer_size < 2) {
    241241    errmsg("Error: got buffer_size %d, but can not be < 2\n", buffer_size);
    242242    usage ( stderr, 1 );
    243   } else if (buffer_size < hop_size + 1) {
     243  } else if ((sint_t)buffer_size < (sint_t)hop_size + 1) {
    244244    errmsg("Error: hop size (%d) is larger than or equal to win size (%d)\n",
    245         buffer_size, hop_size);
     245        hop_size, buffer_size);
     246    usage ( stderr, 1 );
     247  }
     248
     249  if ((sint_t)samplerate < 0) {
     250    errmsg("Error: got samplerate %d, but can not be < 0\n", samplerate);
    246251    usage ( stderr, 1 );
    247252  }
Note: See TracChangeset for help on using the changeset viewer.