From: Mariusz Bialonczyk Date: Tue, 19 Nov 2013 13:57:44 +0000 (+0100) Subject: capmt: do not duplicate subscribed services X-Git-Tag: v4.1~2379^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F305%2Fhead;p=thirdparty%2Ftvheadend.git capmt: do not duplicate subscribed services descrambler_service_start() was sometimes called multiple times resulting in duplicate start of capmt server for the same service. --- diff --git a/src/descrambler/capmt.c b/src/descrambler/capmt.c index de54a3a60..e95132eaf 100644 --- a/src/descrambler/capmt.c +++ b/src/descrambler/capmt.c @@ -898,6 +898,14 @@ capmt_service_start(service_t *s) return; tuner = lfe->lfe_adapter->la_dvb_number; + TAILQ_FOREACH(capmt, &capmts, capmt_link) { + LIST_FOREACH(ct, &capmt->capmt_services, ct_link) { + /* skip, if we already have this service */ + if (ct->ct_service == t) + return; + } + } + TAILQ_FOREACH(capmt, &capmts, capmt_link) { /* skip, if we're not active */ if (!capmt->capmt_enabled)