From d8a084d14cc75cab62a931ee696be80fbf33723e Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Mon, 4 Nov 2013 08:47:57 +0000 Subject: [PATCH] linuxdvb: fix port configuration for 2/4 port special modes Soem truely horrible code in here now, oh well, that's DVB-S for you! --- src/input/mpegts/linuxdvb/linuxdvb_satconf.c | 29 +++++++++++++++++--- src/input/mpegts/linuxdvb/linuxdvb_switch.c | 4 +-- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c index a9d70ec6..bc0ef5e9 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c @@ -431,13 +431,19 @@ linuxdvb_satconf_create /* Create elements */ i = 0; - TAILQ_FOREACH(lse, &ls->ls_elements, ls_link) + TAILQ_FOREACH(lse, &ls->ls_elements, ls_link) { + if (!lse->ls_lnb) + lse->ls_lnb = linuxdvb_lnb_create0(NULL, NULL, lse); + if (lst->ports > 1 && !lse->ls_switch) + lse->ls_switch = linuxdvb_switch_create0("Generic", NULL, lse, i, -1); i++; + } for (; i < lst->ports; i++) { lse = linuxdvb_satconf_ele_create0(NULL, NULL, ls); lse->ls_lnb = linuxdvb_lnb_create0(NULL, NULL, lse); - if (lst->ports > 1) - lse->ls_switch = linuxdvb_switch_create0(NULL, NULL, lse, i, -1); + if (lst->ports > 1) { + lse->ls_switch = linuxdvb_switch_create0("Generic", NULL, lse, i, -1); + } } return ls; @@ -447,7 +453,7 @@ void linuxdvb_satconf_save ( linuxdvb_satconf_t *ls, htsmsg_t *m ) { linuxdvb_satconf_ele_t *lse; - htsmsg_t *l, *e; + htsmsg_t *l, *e, *c; htsmsg_add_str(m, "type", ls->ls_type); idnode_save(&ls->ls_id, m); l = htsmsg_create_list(); @@ -455,6 +461,21 @@ linuxdvb_satconf_save ( linuxdvb_satconf_t *ls, htsmsg_t *m ) e = htsmsg_create_map(); idnode_save(&lse->ti_id, e); htsmsg_add_str(e, "uuid", idnode_uuid_as_str(&lse->ti_id)); + if (lse->ls_lnb) { + c = htsmsg_create_map(); + idnode_save(&lse->ls_lnb->ld_id, c); + htsmsg_add_msg(e, "lnb_conf", c); + } + if (lse->ls_switch) { + c = htsmsg_create_map(); + idnode_save(&lse->ls_switch->ld_id, c); + htsmsg_add_msg(e, "switch_conf", c); + } + if (lse->ls_rotor) { + c = htsmsg_create_map(); + idnode_save(&lse->ls_rotor->ld_id, c); + htsmsg_add_msg(e, "rotor_conf", c); + } htsmsg_add_msg(l, NULL, e); } htsmsg_add_msg(m, "elements", l); diff --git a/src/input/mpegts/linuxdvb/linuxdvb_switch.c b/src/input/mpegts/linuxdvb/linuxdvb_switch.c index 445ffbf4..782a970a 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_switch.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_switch.c @@ -97,8 +97,8 @@ const idclass_t linuxdvb_switch_class = }, { .type = PT_INT, - .id = "Tone Burst", - .name = "toneburst", + .id = "toneburst", + .name = "Tone Burst", .off = offsetof(linuxdvb_switch_t, ls_toneburst), .list = linuxdvb_switch_class_toneburst_list },