aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorMartin Peach <mrpeach@users.sourceforge.net>2010-03-16 17:22:15 +0000
committerMartin Peach <mrpeach@users.sourceforge.net>2010-03-16 17:22:15 +0000
commit1f5a5bbe0f5f0fc07d5635d499eee149b2c83843 (patch)
treef2a5bec4710ac5f47b4dcce4b5183dca40647b2d /net
parentfacd64bcfbb267932e8d3604ebada4bf7fd5b61d (diff)
Output valid state only when it changes.
svn path=/trunk/externals/mrpeach/; revision=13216
Diffstat (limited to 'net')
-rw-r--r--net/udpreceive~.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/net/udpreceive~.c b/net/udpreceive~.c
index 5b88088..74d49fc 100644
--- a/net/udpreceive~.c
+++ b/net/udpreceive~.c
@@ -476,13 +476,21 @@ static t_int *udpreceive_tilde_perform(t_int *w)
}
else x->x_blockssincerecv++;
- if (x->x_valid != 1) outlet_float(x->x_validout, 1);
+ if (x->x_valid != 1)
+ {
+ x->x_valid = 1;
+ outlet_float(x->x_validout, x->x_valid);
+ }
return (w + offset + x->x_noutlets);
bail:
/* set output to zero */
while (n--) for (i = 0; i < x->x_noutlets; i++) *(out[i]++) = 0.;
- if (x->x_valid != 0) outlet_float(x->x_validout, 0);
+ if (x->x_valid != 0)
+ {
+ x->x_valid = 0;
+ outlet_float(x->x_validout, x->x_valid);
+ }
return (w + offset + x->x_noutlets);
}