From: Jaroslav Kysela Date: Tue, 18 Mar 2014 16:50:54 +0000 (+0100) Subject: Fix the sp_reject_filter logic X-Git-Tag: v4.1~2220^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4269cb7818d9581f03dea0af619cfbc2a8b25995;p=thirdparty%2Ftvheadend.git Fix the sp_reject_filter logic This patch fixes the optimization from the commit "PID lookup, streaming pad filter and sbuf alloc optimizations". --- diff --git a/src/streaming.c b/src/streaming.c index 4bfd50735..0c63c6a3e 100644 --- a/src/streaming.c +++ b/src/streaming.c @@ -31,7 +31,7 @@ streaming_pad_init(streaming_pad_t *sp) { LIST_INIT(&sp->sp_targets); sp->sp_ntargets = 0; - sp->sp_reject_filter = 0; + sp->sp_reject_filter = ~0; } /** @@ -117,7 +117,7 @@ streaming_target_connect(streaming_pad_t *sp, streaming_target_t *st) sp->sp_ntargets++; st->st_pad = sp; LIST_INSERT_HEAD(&sp->sp_targets, st, st_link); - sp->sp_reject_filter |= st->st_reject_filter; + sp->sp_reject_filter &= st->st_reject_filter; } @@ -134,9 +134,9 @@ streaming_target_disconnect(streaming_pad_t *sp, streaming_target_t *st) LIST_REMOVE(st, st_link); - filter = 0; + filter = ~0; LIST_FOREACH(st, &sp->sp_targets, st_link) - filter |= st->st_reject_filter; + filter &= st->st_reject_filter; sp->sp_reject_filter = filter; }