]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
dvbcam: Fixed crash when a DVB CAM has been found
authorJasmin Jessich <jasmin@anw.at>
Thu, 26 Oct 2017 18:51:39 +0000 (20:51 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 27 Oct 2017 14:36:59 +0000 (16:36 +0200)
Signed-off-by: Jasmin Jessich <jasmin@anw.at>
src/descrambler/caclient.c
src/descrambler/dvbcam.h

index fe1c8f04353f09e9aafee20e0cc814507c26c57b..9d7d9c4e62e1ecc48ee3663c5edf27bceb3103a3 100644 (file)
@@ -19,6 +19,7 @@
 #include "tvheadend.h"
 #include "settings.h"
 #include "caclient.h"
+#include "dvbcam.h"
 
 const idclass_t *caclient_classes[] = {
 #if ENABLE_LINUXDVB_CA
@@ -397,18 +398,20 @@ caclient_init(void)
   for (r = caclient_classes; *r; r++)
     idclass_register(*r);
 
-  if (!(c = hts_settings_load("caclient")))
-    return;
-  HTSMSG_FOREACH(f, c) {
-    if (!(e = htsmsg_field_get_map(f)))
-      continue;
-    caclient_create(f->hmf_name, e, 0);
+  if ((c = hts_settings_load("caclient"))) {
+    HTSMSG_FOREACH(f, c) {
+      if (!(e = htsmsg_field_get_map(f)))
+        continue;
+      caclient_create(f->hmf_name, e, 0);
+    }
+    htsmsg_destroy(c);
   }
-  htsmsg_destroy(c);
 
 #if ENABLE_LINUXDVB_CA
   {
     caclient_t *cac;
+
+    dvbcam_init();
     pthread_mutex_lock(&caclients_mutex);
     TAILQ_FOREACH(cac, &caclients, cac_link)
       if (idnode_is_instance(&cac->cac_id, &caclient_dvbcam_class))
index 79d04b04c6f18118c6cf3c0b971fe87cec516f8d..8d1eede9260638a7ced8ee3d5a4667654d8c0780 100644 (file)
@@ -29,7 +29,7 @@ struct linuxdvb_ca;
 void dvbcam_init(void);
 void dvbcam_register_cam(struct linuxdvb_ca *lca, uint8_t slot, uint16_t * caids, int num_caids);
 void dvbcam_unregister_cam(struct linuxdvb_ca *lca, uint8_t slot);
-void dvbcam_pmt_data(mpegts_service_t *s, const uint8_t *ptr, int len);
+void dvbcam_pmt_data(struct mpegts_service *s, const uint8_t *ptr, int len);
 
 #endif