]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
linuxdvb: fix configuration processing
authorAdam Sutton <dev@adamsutton.me.uk>
Sun, 27 Oct 2013 21:29:05 +0000 (21:29 +0000)
committerAdam Sutton <dev@adamsutton.me.uk>
Sun, 27 Oct 2013 23:19:02 +0000 (23:19 +0000)
src/input/mpegts/linuxdvb/linuxdvb_frontend.c
src/input/mpegts/linuxdvb/linuxdvb_private.h
src/input/mpegts/linuxdvb/linuxdvb_satconf.c

index ae536cd6175a6dc52b3d9c38954e6acf184805b3..5af79d565d2c0562f7f5769f3245be7894c28735 100644 (file)
@@ -185,7 +185,7 @@ linuxdvb_frontend_dvbs_class_satconf_set ( void *self, const void *str )
   if (lfe->lfe_satconf && !strcmp(str ?: "", lfe->lfe_satconf->ls_type))
     return 0;
   linuxdvb_satconf_destroy(lfe->lfe_satconf);
-  lfe->lfe_satconf = linuxdvb_satconf_create(lfe, str);
+  lfe->lfe_satconf = linuxdvb_satconf_create(lfe, str, NULL, NULL);
   return 1;
 }
 
@@ -816,6 +816,8 @@ linuxdvb_frontend_create0
   const char *str;
   const idclass_t *idc;
   pthread_t tid;
+  const char *scuuid = NULL, *sctype = NULL;
+  htsmsg_t *scconf = NULL;
 
   /* Get type */
   if (conf) {
@@ -860,9 +862,17 @@ linuxdvb_frontend_create0
   /* Start table thread */
   tvhthread_create(&tid, NULL, mpegts_input_table_thread, lfe, 1);
 
+  /* Satconf */
+  if (conf) {
+    if ((scconf = htsmsg_get_map(conf, "satconf"))) {
+      sctype = htsmsg_get_str(scconf, "type");
+      scuuid = htsmsg_get_str(scconf, "uuid");
+    }
+  }
+
   /* Create satconf */
   if (type == FE_QPSK && !lfe->lfe_satconf)
-    lfe->lfe_satconf = linuxdvb_satconf_create(lfe, "");
+    lfe->lfe_satconf = linuxdvb_satconf_create(lfe, sctype, scuuid, scconf);
 
   /* No conf */
   if (!conf)
@@ -925,14 +935,12 @@ linuxdvb_frontend_save ( linuxdvb_frontend_t *lfe, htsmsg_t *m )
 {
   mpegts_input_save((mpegts_input_t*)lfe, m);
   htsmsg_add_str(m, "type", dvb_type2str(lfe->lfe_info.type));
-htsmsg_print(m);
   if (lfe->lfe_satconf) {
     htsmsg_t *s = htsmsg_create_map();
     linuxdvb_satconf_save(lfe->lfe_satconf, s);
     htsmsg_add_str(s, "uuid", idnode_uuid_as_str(&lfe->lfe_satconf->ls_id));
     htsmsg_add_msg(m, "satconf", s);
   }
-htsmsg_print(m);
 }
 
 /******************************************************************************
index 92f7addf54d0059617ba92f370e9f0804a229bd4..44a7015210f5f9d99642f5703f54fdadd1da140b 100644 (file)
@@ -346,17 +346,13 @@ void linuxdvb_satconf_ele_destroy ( linuxdvb_satconf_ele_t *ls );
 
 htsmsg_t *linuxdvb_satconf_type_list ( void *o );
 
-linuxdvb_satconf_t *linuxdvb_satconf_create0(const char *uuid, htsmsg_t *conf);
-
 linuxdvb_satconf_t *linuxdvb_satconf_create
-  ( linuxdvb_frontend_t *lfe, const char *type );
+  ( linuxdvb_frontend_t *lfe,
+    const char *type, const char *uuid, htsmsg_t *conf );
 
 void linuxdvb_satconf_delete ( linuxdvb_satconf_t *ls );
 void linuxdvb_satconf_destroy ( linuxdvb_satconf_t *ls );
 
-linuxdvb_satconf_t *linuxdvb_satconf_create 
-  ( linuxdvb_frontend_t *lfe, const char *type );
-
 void linuxdvb_satconf_destroy ( linuxdvb_satconf_t *ls );
 
 #endif /* __TVH_LINUXDVB_PRIVATE_H__ */
index 5e48b0a3ea23934088d805cbef0ef1f0c65703c1..a83e783a618d765881a501025b02d99794c982fc 100644 (file)
@@ -77,13 +77,10 @@ linuxdvb_satconf_class_network_set
 {
   int i = 0;
   linuxdvb_satconf_ele_t *lse;
-  printf("SET NETWORK %p %d = %s\n", ls, idx, uuid);
   LIST_FOREACH(lse, &ls->ls_elements, ls_link) {
-    printf("element\n");
     if (i == idx) break;
     i++;
   }
-  printf("lse = %p\n", lse);
   if (lse)
     return linuxdvb_satconf_ele_class_network_set(lse, uuid);
   return 0;
@@ -369,14 +366,13 @@ linuxdvb_satconf_destroy ( linuxdvb_satconf_t *ls )
 
 linuxdvb_satconf_t *
 linuxdvb_satconf_create
-  ( linuxdvb_frontend_t *lfe, const char *type )
+  ( linuxdvb_frontend_t *lfe, const char *type, const char *uuid,
+    htsmsg_t *conf )
 {
   int i;
   linuxdvb_satconf_ele_t *lse;
   struct linuxdvb_satconf_type *lst
     = linuxdvb_satconf_type_find(type);
-  const char *uuid = NULL;//"TODO";
-  htsmsg_t *conf = NULL;
   assert(lst);
   
   linuxdvb_satconf_t *ls = calloc(1, sizeof(linuxdvb_satconf_t));
@@ -446,7 +442,6 @@ linuxdvb_satconf_ele_class_network_set(void *o, const void *v)
   mpegts_input_t   *mi = o;
   mpegts_network_t *mn = mi->mi_network;
   const char *s = v;
-  printf("SET NETWORK %s\n", (const char*)v);
 
   if (mi->mi_network && !strcmp(idnode_uuid_as_str(&mn->mn_id), s ?: ""))
     return 0;