]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
linuxdvb: fix satconf active/enable handling, fixes #4365
authorJaroslav Kysela <perex@perex.cz>
Thu, 11 May 2017 13:25:29 +0000 (15:25 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 12 May 2017 19:45:43 +0000 (21:45 +0200)
src/htsmsg.c
src/htsmsg.h
src/input/mpegts/linuxdvb/linuxdvb_satconf.c

index b81a1e35ce22b82d0d1c376b9790650925c3b41e..6744481b4495b778dcb04219e96752da0ef8cd85 100644 (file)
@@ -309,6 +309,18 @@ htsmsg_add_bool(htsmsg_t *msg, const char *name, int b)
   f->hmf_bool = !!b;
 }
 
+/*
+ *
+ */
+void
+htsmsg_set_bool(htsmsg_t *msg, const char *name, int b)
+{
+  htsmsg_field_t *f = htsmsg_field_find(msg, name);
+  if (!f)
+    f = htsmsg_field_add(msg, name, HMF_BOOL, HMF_NAME_INALLOCED, 0);
+  f->hmf_bool = !!b;
+}
+
 /*
  *
  */
index fc20f18b92450951e6e66070aa47b7694411f224..47f765cea5c30de13e1bd5338e048382ccc27349 100644 (file)
@@ -119,8 +119,16 @@ void htsmsg_field_destroy(htsmsg_t *msg, htsmsg_field_t *f);
  */
 void htsmsg_destroy(htsmsg_t *msg);
 
+/**
+ * Add an boolean field.
+ */
 void htsmsg_add_bool(htsmsg_t *msg, const char *name, int b);
 
+/**
+ * Add/update an boolean field.
+ */
+void htsmsg_set_bool(htsmsg_t *msg, const char *name, int b);
+
 /**
  * Add an integer field where source is signed 64 bit.
  */
index 8820849b491162caa964fa780b757b5ecca8b06e..817d299772a6e5f161a39eb54806d38d86c8f80a 100644 (file)
@@ -1185,9 +1185,9 @@ linuxdvb_satconf_create
           htsmsg_add_str(l, NULL, str);
           htsmsg_add_msg(e, "networks", l);
         }
-        lse = linuxdvb_satconf_ele_create0(htsmsg_get_str(e, "uuid"), e, ls);
         if (lst->enable)
-          lse->lse_enabled = 1;
+          htsmsg_set_bool(e, "enabled", 1);
+        lse = linuxdvb_satconf_ele_create0(htsmsg_get_str(e, "uuid"), e, ls);
       }
     }