Index: include/libroardsp/libroardsp.h
===================================================================
--- include/libroardsp/libroardsp.h	(revision 1131)
+++ include/libroardsp/libroardsp.h	(revision 1141)
@@ -137,4 +137,5 @@
 int roardsp_lowp_calc16(struct roardsp_filter * filter, void * data, size_t samples);
 int roardsp_lowp_ctl   (struct roardsp_filter * filter, int cmd, void * data);
+int roardsp_lowp_reset (struct roardsp_filter * filter, int what);
 
 int roardsp_highp_init  (struct roardsp_filter * filter, struct roar_stream * stream, int id);
@@ -142,4 +143,5 @@
 int roardsp_highp_calc16(struct roardsp_filter * filter, void * data, size_t samples);
 int roardsp_highp_ctl   (struct roardsp_filter * filter, int cmd, void * data);
+int roardsp_highp_reset (struct roardsp_filter * filter, int what);
 #endif
 
@@ -149,7 +151,9 @@
 int roardsp_amp_calc8 (struct roardsp_filter * filter, void * data, size_t samples);
 int roardsp_amp_ctl   (struct roardsp_filter * filter, int cmd, void * data);
+int roardsp_amp_reset (struct roardsp_filter * filter, int what);
 
 int roardsp_add_init  (struct roardsp_filter * filter, struct roar_stream * stream, int id);
 int roardsp_add_calc16(struct roardsp_filter * filter, void * data, size_t samples);
+int roardsp_add_reset (struct roardsp_filter * filter, int what);
 
 int roardsp_quantify_init  (struct roardsp_filter * filter, struct roar_stream * stream, int id);
@@ -157,12 +161,14 @@
 int roardsp_quantify_calc16(struct roardsp_filter * filter, void * data, size_t samples);
 int roardsp_quantify_ctl   (struct roardsp_filter * filter, int cmd, void * data);
+int roardsp_quantify_reset (struct roardsp_filter * filter, int what);
 
-int roardsp_clip_init  (struct roardsp_filter * filter, struct roar_stream * stream, int id);
 int roardsp_clip_calc16(struct roardsp_filter * filter, void * data, size_t samples);
 int roardsp_clip_ctl   (struct roardsp_filter * filter, int cmd, void * data);
+int roardsp_clip_reset (struct roardsp_filter * filter, int what);
 
 int roardsp_downmix_init   (struct roardsp_filter * filter, struct roar_stream * stream, int id);
 int roardsp_downmix_calc162(struct roardsp_filter * filter, void * data, size_t samples);
 int roardsp_downmix_ctl    (struct roardsp_filter * filter, int cmd, void * data);
+int roardsp_downmix_reset  (struct roardsp_filter * filter, int what);
 
 int roardsp_dcblock_init   (struct roardsp_filter * filter, struct roar_stream * stream, int id);
Index: libroardsp/filter.c
===================================================================
--- libroardsp/filter.c	(revision 1134)
+++ libroardsp/filter.c	(revision 1141)
@@ -34,19 +34,19 @@
  int (*calc  [5][3])(struct roardsp_filter * filter, void * data, size_t samples);
 } _roardsp_filterlist[] = {
- {ROARDSP_FILTER_AMP, "AMP", roardsp_amp_init, roardsp_amp_uninit, roardsp_amp_ctl, NULL, {
+ {ROARDSP_FILTER_AMP, "AMP", roardsp_amp_init, roardsp_amp_uninit, roardsp_amp_ctl, roardsp_amp_reset, {
            {NULL, NULL, NULL},{roardsp_amp_calc8, NULL, NULL},{roardsp_amp_calc16, NULL, NULL},{NULL, NULL, NULL},{NULL, NULL, NULL}}},
- {ROARDSP_FILTER_ADD, "Add", roardsp_add_init, roardsp_amp_uninit, roardsp_amp_ctl, NULL, {
+ {ROARDSP_FILTER_ADD, "Add", roardsp_add_init, roardsp_amp_uninit, roardsp_amp_ctl, roardsp_add_reset, {
            {NULL, NULL, NULL},{NULL, NULL, NULL},{roardsp_add_calc16, NULL, NULL},{NULL, NULL, NULL},{NULL, NULL, NULL}}},
 #ifdef ROAR_HAVE_LIBM
- {ROARDSP_FILTER_LOWP, "Lowpass", roardsp_lowp_init, roardsp_lowp_uninit, roardsp_lowp_ctl, NULL, {
+ {ROARDSP_FILTER_LOWP, "Lowpass", roardsp_lowp_init, roardsp_lowp_uninit, roardsp_lowp_ctl, roardsp_lowp_reset, {
            {NULL, NULL, NULL},{NULL, NULL, NULL},{roardsp_lowp_calc16, NULL, NULL},{NULL, NULL, NULL},{NULL, NULL, NULL}}},
- {ROARDSP_FILTER_HIGHP, "Highpass", roardsp_highp_init, roardsp_highp_uninit, roardsp_highp_ctl, NULL, {
+ {ROARDSP_FILTER_HIGHP, "Highpass", roardsp_highp_init, roardsp_highp_uninit, roardsp_highp_ctl, roardsp_highp_reset, {
            {NULL, NULL, NULL},{NULL, NULL, NULL},{roardsp_highp_calc16, NULL, NULL},{NULL, NULL, NULL},{NULL, NULL, NULL}}},
 #endif
- {ROARDSP_FILTER_QUANTIFY, "Quantifier", roardsp_quantify_init, NULL, roardsp_quantify_ctl, NULL, {
+ {ROARDSP_FILTER_QUANTIFY, "Quantifier", roardsp_quantify_init, NULL, roardsp_quantify_ctl, roardsp_quantify_reset, {
            {NULL, NULL, NULL},{NULL, NULL, NULL},{roardsp_quantify_calc16, NULL, NULL},{NULL, NULL, NULL},{NULL, NULL, NULL}}},
- {ROARDSP_FILTER_CLIP, "Clip", roardsp_clip_init, NULL, roardsp_clip_ctl, NULL, {
+ {ROARDSP_FILTER_CLIP, "Clip", roardsp_quantify_init, NULL, roardsp_clip_ctl, roardsp_clip_reset, {
            {NULL, NULL, NULL},{NULL, NULL, NULL},{roardsp_clip_calc16, NULL, NULL},{NULL, NULL, NULL},{NULL, NULL, NULL}}},
- {ROARDSP_FILTER_DOWNMIX, "downmix", roardsp_downmix_init, NULL, roardsp_downmix_ctl, NULL, {
+ {ROARDSP_FILTER_DOWNMIX, "downmix", roardsp_quantify_init, NULL, roardsp_downmix_ctl, roardsp_downmix_reset, {
            {NULL, NULL, NULL},{NULL, NULL, NULL},{NULL, NULL, roardsp_downmix_calc162},{NULL, NULL, NULL},{NULL, NULL, NULL}}},
  {ROARDSP_FILTER_DCBLOCK, "DCBlock", roardsp_dcblock_init, NULL, NULL, roardsp_dcblock_reset, {
Index: libroardsp/filter_add.c
===================================================================
--- libroardsp/filter_add.c	(revision 979)
+++ libroardsp/filter_add.c	(revision 1141)
@@ -27,5 +27,4 @@
 int roardsp_add_init  (struct roardsp_filter * filter, struct roar_stream * stream, int id) {
  struct roardsp_amp * self = malloc(sizeof(struct roardsp_amp));
- int32_t fac;
 
  if ( self == NULL )
@@ -36,8 +35,5 @@
  filter->inst = (void*) self;
 
- fac = 0;
- roardsp_amp_ctl(filter, ROARDSP_FCTL_MUL, &fac);
- fac = 1;
- roardsp_amp_ctl(filter, ROARDSP_FCTL_DIV, &fac);
+ roardsp_filter_reset(filter, ROARDSP_RESET_FULL);
 
  return 0;
@@ -56,3 +52,31 @@
 }
 
+int roardsp_add_reset (struct roardsp_filter * filter, int what) {
+ struct roardsp_amp * self;
+
+ if ( filter == NULL )
+  return -1;
+
+ if ( filter->inst == NULL )
+  return -1;
+
+ self = filter->inst;
+
+ switch (what) {
+  case ROARDSP_RESET_NONE:
+  case ROARDSP_RESET_STATE:
+    return  0;
+   break;
+  case ROARDSP_RESET_FULL:
+    self->mul = 0;
+    self->div = 1;
+    return  0;
+   break;
+  default:
+    return -1;
+ }
+
+ return -1;
+}
+
 //ll
Index: libroardsp/filter_amp.c
===================================================================
--- libroardsp/filter_amp.c	(revision 882)
+++ libroardsp/filter_amp.c	(revision 1141)
@@ -27,5 +27,4 @@
 int roardsp_amp_init  (struct roardsp_filter * filter, struct roar_stream * stream, int id) {
  struct roardsp_amp * self = malloc(sizeof(struct roardsp_amp));
- int32_t fac;
 
  if ( self == NULL )
@@ -36,8 +35,5 @@
  filter->inst = (void*) self;
 
- fac = 1;
- roardsp_amp_ctl(filter, ROARDSP_FCTL_MUL, &fac);
- fac = 1;
- roardsp_amp_ctl(filter, ROARDSP_FCTL_DIV, &fac);
+ roardsp_filter_reset(filter, ROARDSP_RESET_FULL);
 
  return 0;
@@ -103,3 +99,31 @@
 }
 
+int roardsp_amp_reset (struct roardsp_filter * filter, int what) {
+ struct roardsp_amp * self;
+
+ if ( filter == NULL )
+  return -1;
+
+ if ( filter->inst == NULL )
+  return -1;
+
+ self = filter->inst;
+
+ switch (what) {
+  case ROARDSP_RESET_NONE:
+  case ROARDSP_RESET_STATE:
+    return  0;
+   break;
+  case ROARDSP_RESET_FULL:
+    self->mul = 1;
+    self->div = 1;
+    return  0;
+   break;
+  default:
+    return -1;
+ }
+
+ return -1;
+}
+
 //ll
Index: libroardsp/filter_clip.c
===================================================================
--- libroardsp/filter_clip.c	(revision 987)
+++ libroardsp/filter_clip.c	(revision 1141)
@@ -24,12 +24,4 @@
 
 #include "libroardsp.h"
-
-int roardsp_clip_init  (struct roardsp_filter * filter, struct roar_stream * stream, int id) {
- int n = 64;
-
- roardsp_amp_ctl(filter, ROARDSP_FCTL_N, &n);
-
- return 0;
-}
 
 int roardsp_clip_calc16  (struct roardsp_filter * filter, void * data, size_t samples) {
@@ -67,3 +59,25 @@
 }
 
+int roardsp_clip_reset (struct roardsp_filter * filter, int what) {
+ int32_t n = 16384;
+
+ if ( filter == NULL )
+  return -1;
+
+ switch (what) {
+  case ROARDSP_RESET_NONE:
+  case ROARDSP_RESET_STATE:
+    return  0;
+   break;
+  case ROARDSP_RESET_FULL:
+    roardsp_clip_ctl(filter, ROARDSP_FCTL_LIMIT, &n);
+    return  0;
+   break;
+  default:
+    return -1;
+ }
+
+ return -1;
+}
+
 //ll
Index: libroardsp/filter_downmix.c
===================================================================
--- libroardsp/filter_downmix.c	(revision 1104)
+++ libroardsp/filter_downmix.c	(revision 1141)
@@ -24,13 +24,4 @@
 
 #include "libroardsp.h"
-
-int roardsp_downmix_init  (struct roardsp_filter * filter, struct roar_stream * stream, int id) {
- int mode = ROARDSP_DOWNMIX_ARITHMETIC;
-
- roardsp_downmix_ctl(filter, ROARDSP_FCTL_MODE, &mode);
-
- ROAR_DBG("roardsp_downmix_init(*) = 0");
- return 0;
-}
 
 int roardsp_downmix_calc162  (struct roardsp_filter * filter, void * data, size_t samples) {
@@ -106,3 +97,25 @@
 }
 
+int roardsp_downmix_reset  (struct roardsp_filter * filter, int what) {
+ int mode = ROARDSP_DOWNMIX_ARITHMETIC;
+
+ if ( filter == NULL )
+  return -1;
+
+ switch (what) {
+  case ROARDSP_RESET_NONE:
+  case ROARDSP_RESET_STATE:
+    return  0;
+   break;
+  case ROARDSP_RESET_FULL:
+    roardsp_downmix_ctl(filter, ROARDSP_FCTL_MODE, &mode);
+    return  0;
+   break;
+  default:
+    return -1;
+ }
+
+ return -1;
+}
+
 //ll
Index: libroardsp/filter_highp.c
===================================================================
--- libroardsp/filter_highp.c	(revision 1104)
+++ libroardsp/filter_highp.c	(revision 1141)
@@ -111,4 +111,34 @@
 }
 
+int roardsp_highp_reset (struct roardsp_filter * filter, int what) {
+ struct roardsp_highp * self;
+ float freq = 25;
+
+ if ( filter == NULL )
+  return -1;
+
+ if ( filter->inst == NULL )
+  return -1;
+
+ self = filter->inst;
+
+ switch (what) {
+  case ROARDSP_RESET_NONE:
+    return  0;
+   break;
+  case ROARDSP_RESET_FULL:
+    roardsp_highp_ctl(filter, ROARDSP_FCTL_FREQ, &freq);
+  case ROARDSP_RESET_STATE:
+    memset(self->oldin,  0, sizeof(int32_t)*ROAR_MAX_CHANNELS);
+    memset(self->oldout, 0, sizeof(int32_t)*ROAR_MAX_CHANNELS);
+    return  0;
+   break;
+  default:
+    return -1;
+ }
+
+ return -1;
+}
+
 #endif
 
Index: libroardsp/filter_lowp.c
===================================================================
--- libroardsp/filter_lowp.c	(revision 1104)
+++ libroardsp/filter_lowp.c	(revision 1141)
@@ -107,4 +107,34 @@
 }
 
+int roardsp_lowp_reset (struct roardsp_filter * filter, int what) {
+ struct roardsp_lowp * self;
+ float freq;
+
+ if ( filter == NULL )
+  return -1;
+
+ if ( filter->inst == NULL )
+  return -1;
+
+ self = filter->inst;
+ freq = filter->rate/2;
+
+ switch (what) {
+  case ROARDSP_RESET_NONE:
+    return  0;
+   break;
+  case ROARDSP_RESET_FULL:
+    roardsp_lowp_ctl(filter, ROARDSP_FCTL_FREQ, &freq);
+  case ROARDSP_RESET_STATE:
+    memset(self->old, 0, sizeof(int32_t)*ROAR_MAX_CHANNELS);
+    return  0;
+   break;
+  default:
+    return -1;
+ }
+
+ return -1;
+}
+
 #endif
 
Index: libroardsp/filter_quantify.c
===================================================================
--- libroardsp/filter_quantify.c	(revision 987)
+++ libroardsp/filter_quantify.c	(revision 1141)
@@ -26,9 +26,7 @@
 
 int roardsp_quantify_init  (struct roardsp_filter * filter, struct roar_stream * stream, int id) {
- int n = 64;
 
- roardsp_amp_ctl(filter, ROARDSP_FCTL_N, &n);
+ roardsp_filter_reset(filter, ROARDSP_RESET_FULL);
 
- ROAR_DBG("roardsp_quantify_init(*) = 0");
  return 0;
 }
@@ -71,3 +69,25 @@
 }
 
+int roardsp_quantify_reset (struct roardsp_filter * filter, int what) {
+ int n = 64;
+
+ if ( filter == NULL )
+  return -1;
+
+ switch (what) {
+  case ROARDSP_RESET_NONE:
+  case ROARDSP_RESET_STATE:
+    return  0;
+   break;
+  case ROARDSP_RESET_FULL:
+    roardsp_quantify_ctl(filter, ROARDSP_FCTL_N, &n);
+    return  0;
+   break;
+  default:
+    return -1;
+ }
+
+ return -1;
+}
+
 //ll
