Index: roarclients/roarfilt.c
===================================================================
--- roarclients/roarfilt.c	(revision 5823)
+++ roarclients/roarfilt.c	(revision 5950)
@@ -32,11 +32,4 @@
 
 #define BUFFERSIZE 1024
-
-#ifdef ROAR_HAVE_LIBM
-struct {
- uint16_t a, b;
- int16_t  old[ROAR_MAX_CHANNELS];
-} g_lowpass;
-#endif
 
 void usage (void) {
@@ -57,7 +50,4 @@
         "  --mul VAL           - Set mul\n"
         "  --div VAL           - Set div\n"
-#ifdef ROAR_HAVE_LIBM
-        "  --lowpass freq      - lowpass filter (obsolete)\n"
-#endif
         "  --filter  name      - add filter name\n"
         "  --ffreq   freq      - set filter freq\n"
@@ -87,53 +77,4 @@
 _volX(32,64,4)
 
-#ifdef ROAR_HAVE_LIBM
-void logs2 (void * data, float scale, int len) {
- int16_t * samples = (int16_t *) data;
- int i;
- float div = logf(scale);
- float scalemul = scale - 1;
- int neg;
-
- len /= 2;
-
- //printf("logs2(data=%p, scale=%f, len=%i): scalemul=%f, div=%f\n", data, scale, len, scalemul, div);
-
- for (i = 0; i < len; i++) {
-  if ( (neg = (samples[i] < 0)) ) 
-   samples[i] = abs(samples[i]);
-
-
-  samples[i] = (neg ? 32768.0 : 32767.0)*logf(1 + (scalemul*(float)samples[i]/(neg ? 32768.0 : 32767.0))) / div;
-
-  if ( neg )
-   samples[i] *= -1;
- }
-}
-
-void lowpass2 (void * data, int len, int channels) {
- int16_t * samples = (int16_t *) data;
- register int32_t s;
- int i, c;
-
- if ( channels > ROAR_MAX_CHANNELS )
-  return;
-
- len /= 2 * channels;
-
-//  *      output[N] = input[N] * A + output[N-1] * B
-
- for (i = 0; i < len; i++) {
-  for (c = 0; c < channels; c++) {
-   s = samples[i*channels + c] * g_lowpass.a + g_lowpass.old[c] * g_lowpass.b;
-
-   s /= 65536;
-
-   samples[i*channels + c] = s;
-   g_lowpass.old[       c] = s;
-  }
- }
-}
-#endif
-
 int main (int argc, char * argv[]) {
  struct roar_audio_info info;
@@ -144,6 +85,5 @@
  int     filter_id;
  int32_t tmp;
- float   logscale = 0;
- float   lp       = 0;
+ float   tmpfp;
  char    buf[BUFFERSIZE];
  struct roardsp_filterchain fc;
@@ -156,8 +96,4 @@
  info.codec = ROAR_CODEC_DEFAULT;
 
-#ifdef ROAR_HAVE_LIBM
- memset(&g_lowpass, 0, sizeof(g_lowpass));
-#endif
-
  roardsp_fchain_init(&fc);
 
@@ -166,10 +102,14 @@
 
   if ( strcmp(k, "--server") == 0 || strcmp(k, "-s") == 0 ) {
+   ROAR_CKHAVEARGS(1);
    server = argv[++i];
   } else if ( strcmp(k, "--rate") == 0 || strcmp(k, "-R") == 0 || strcmp(k, "-r") == 0 ) {
+   ROAR_CKHAVEARGS(1);
    info.rate = roar_str2rate(argv[++i]);
   } else if ( strcmp(k, "--bits") == 0 || strcmp(k, "-B") == 0 ) {
+   ROAR_CKHAVEARGS(1);
    info.bits = roar_str2bits(argv[++i]);
   } else if ( strcmp(k, "--channels") == 0 || strcmp(k, "--chans") == 0 || strcmp(k, "-C") == 0 ) {
+   ROAR_CKHAVEARGS(1);
    info.channels = roar_str2channels(argv[++i]);
   } else if ( strcmp(k, "-b") == 0 ) {
@@ -178,4 +118,5 @@
    info.channels = 1;
   } else if ( !strcmp(k, "--aiprofile") ) {
+   ROAR_CKHAVEARGS(1);
    if ( roar_profile2info(&info, argv[++i]) == -1 ) {
     fprintf(stderr, "Error: Can not load audio profile: %s: %s\n", argv[i], roar_error2str(roar_error));
@@ -188,21 +129,14 @@
    mul *= 2;
   } else if ( strcmp(k, "--amp") == 0 ) {
+   ROAR_CKHAVEARGS(1);
    mul *= atoi(argv[++i]);
   } else if ( strcmp(k, "--mul") == 0 ) {
+   ROAR_CKHAVEARGS(1);
    mul  = atoi(argv[++i]);
   } else if ( strcmp(k, "--div") == 0 ) {
+   ROAR_CKHAVEARGS(1);
    div  = atoi(argv[++i]);
-  } else if ( strcmp(k, "--log") == 0 ) {
-   ROAR_WARN("The logscaler is obsolete and will be removed soon.");
-   logscale = atof(argv[++i]);
-#ifdef ROAR_HAVE_LIBM
-  } else if ( strcmp(k, "--lowpass") == 0 ) {
-   ROAR_WARN("The builtin lowpass is obsolete and will be removed soon. Use --filter lowpass.");
-   lp = exp(-2 * M_PI * atof(argv[++i]) / info.rate) * 65536;
-   g_lowpass.b = lp;
-   g_lowpass.a = 65536 - lp;
-#endif
-//   printf("lowpass: A=%i, B=%i\n", g_lowpass.a, g_lowpass.b);
   } else if ( strcmp(k, "--filter") == 0 ) {
+   ROAR_CKHAVEARGS(1);
    stream.info = info;
    filter_id = roardsp_filter_str2id(argv[++i]);
@@ -219,22 +153,29 @@
    }
   } else if ( strcmp(k, "--ffreq") == 0 ) {
-   lp = atof(argv[++i]);
-   roardsp_filter_ctl(filter, ROARDSP_FCTL_FREQ, &lp);
+   ROAR_CKHAVEARGS(1);
+   tmpfp = atof(argv[++i]);
+   roardsp_filter_ctl(filter, ROARDSP_FCTL_FREQ, &tmpfp);
   } else if ( strcmp(k, "--fmul") == 0 ) {
+   ROAR_CKHAVEARGS(1);
    tmp = atoi(argv[++i]);
    roardsp_filter_ctl(filter, ROARDSP_FCTL_MUL, &tmp);
   } else if ( strcmp(k, "--fdiv") == 0 ) {
+   ROAR_CKHAVEARGS(1);
    tmp = atoi(argv[++i]);
    roardsp_filter_ctl(filter, ROARDSP_FCTL_DIV, &tmp);
   } else if ( strcmp(k, "--fn") == 0 ) {
+   ROAR_CKHAVEARGS(1);
    tmp = atoi(argv[++i]);
    roardsp_filter_ctl(filter, ROARDSP_FCTL_N, &tmp);
   } else if ( strcmp(k, "--fq") == 0 ) {
+   ROAR_CKHAVEARGS(1);
    tmp = atoi(argv[++i]);
    roardsp_filter_ctl(filter, ROARDSP_FCTL_Q, &tmp);
   } else if ( strcmp(k, "--flimit") == 0 ) {
+   ROAR_CKHAVEARGS(1);
    tmp = atoi(argv[++i]);
    roardsp_filter_ctl(filter, ROARDSP_FCTL_LIMIT, &tmp);
   } else if ( strcmp(k, "--fmode") == 0 ) {
+   ROAR_CKHAVEARGS(1);
    tmp = atoi(argv[++i]);
    roardsp_filter_ctl(filter, ROARDSP_FCTL_MODE, &tmp);
@@ -257,7 +198,4 @@
 
  if ( mul == div &&
-#ifdef ROAR_HAVE_LIBM
-      logscale == 0 && g_lowpass.a == 0 &&
-#endif
       roardsp_fchain_num(&fc) == 0 ) {
   fprintf(stderr, "Error: filter is useless!\n");
@@ -278,10 +216,4 @@
      if ( mul != div )
       vol16((void*)buf, mul, div, i);
-#ifdef ROAR_HAVE_LIBM
-     if ( logscale )
-      logs2((void*)buf, logscale, i);
-     if ( g_lowpass.a )
-      lowpass2((void*)buf, i, info.channels);
-#endif
      roardsp_fchain_calc(&fc, (void*)buf, (8*i)/info.bits);
      if (roar_vio_write(&svio, buf, i) != i)
