From: Adam Sutton Date: Wed, 11 Sep 2013 20:04:30 +0000 (+0100) Subject: capmt: fix problems with capmt not being properly enabled X-Git-Tag: v4.1~2530 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=46b3f984c8d8a0dd02fbf4ce7b5668525868a91e;p=thirdparty%2Ftvheadend.git capmt: fix problems with capmt not being properly enabled This was due to failure to properly reported which adapters have been enabled. There are other problems with the capmt setup code that really need addressing, but I don't have the time right now! --- diff --git a/src/descrambler/capmt.c b/src/descrambler/capmt.c index 982379400..e7c175f07 100644 --- a/src/descrambler/capmt.c +++ b/src/descrambler/capmt.c @@ -530,7 +530,7 @@ capmt_create_udp_socket(int *socket, int port) if (bind(*socket, (const struct sockaddr*)&serv_addr, sizeof(serv_addr)) != 0) { - perror("[CapmtServer] ERROR binding to ca0"); + tvherror("capmt", "failed to bind to ca0 (port %d)", port); return 0; } else diff --git a/src/input/mpegts/linuxdvb/linuxdvb_adapter.c b/src/input/mpegts/linuxdvb/linuxdvb_adapter.c index b2fadf60b..9b0e60c05 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_adapter.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_adapter.c @@ -104,6 +104,21 @@ linuxdvb_adapter_current_weight ( linuxdvb_adapter_t *la ) return 0; } +/* + * Enabled + */ +static int +linuxdvb_adapter_is_enabled ( mpegts_input_t *mi ) +{ + linuxdvb_adapter_t *la = (linuxdvb_adapter_t*)mi; + linuxdvb_hardware_t *lh; + + LIST_FOREACH(lh, &la->lh_children, lh_parent_link) + if (lh->mi_is_enabled && lh->mi_is_enabled((mpegts_input_t*)lh)) + return 1; + return 0; +} + /* * Create */ @@ -124,8 +139,9 @@ linuxdvb_adapter_create0 } LIST_INSERT_HEAD(&ld->lh_children, (linuxdvb_hardware_t*)la, lh_parent_link); - la->lh_parent = (linuxdvb_hardware_t*)ld; - la->mi_enabled = 1; + la->lh_parent = (linuxdvb_hardware_t*)ld; + la->mi_is_enabled = linuxdvb_adapter_is_enabled; + la->mi_enabled = 1; /* No conf */ if (!conf)