]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
EN50494: fix subelement creation for multi-port switches
authorInuSasha <inu@inusasha.de>
Sun, 5 Jan 2014 22:47:12 +0000 (23:47 +0100)
committerInuSasha <inu@inusasha.de>
Sun, 5 Jan 2014 22:47:12 +0000 (23:47 +0100)
src/input/mpegts/linuxdvb/linuxdvb_en50494.c
src/input/mpegts/linuxdvb/linuxdvb_satconf.c

index ae9f87472a40ae775430433d7adb066d072e45f9..7b9af649ac61857f96c6281761048301a070dc78 100644 (file)
@@ -176,6 +176,8 @@ linuxdvb_en50494_tune
     tvhlog(LOG_ERR, LINUXDVB_EN50494_NAME, "transponder value bigger then 1024");
     return -1;
   }
+
+  /* tune frequency for the frontend */
   le->le_tune_freq = (t + 350) * 4000 - freq; /* real used en50494 frequency */
 
   /* 2 data fields (16bit) */
index 973c33e5447d07eaca27901dd80298466de85ab1..a59d9bce3ae591dcd1d0c9fc206c8d3a9aedba84 100644 (file)
@@ -471,15 +471,24 @@ linuxdvb_satconf_create
   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);
+    /* create multi port elements (2/4port & en50494) */
+    if (lst->ports > 1) {
+      if( !lse->ls_en50494 && !strcmp("en50494",lst->type))
+        lse->ls_en50494 = linuxdvb_en50494_create0("en50494", NULL, lse);
+      if( !lse->ls_switch && (!strcmp("2port",lst->type) || !strcmp("4port",lst->type)))
+        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);
+    /* create multi port elements (2/4port & en50494) */
     if (lst->ports > 1) {
-      lse->ls_switch = linuxdvb_switch_create0("Generic", NULL, lse, i, -1);
+      if( !strcmp("en50494",lst->type))
+        lse->ls_en50494 = linuxdvb_en50494_create0("en50494", NULL, lse);
+      if( !strcmp("2port",lst->type) || !strcmp("4port",lst->type))
+        lse->ls_switch = linuxdvb_switch_create0("Generic", NULL, lse, i, -1);
     }
   }