]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
linuxdvb satconf: move voltage settings as last (for LNB polarization)
authorJaroslav Kysela <perex@perex.cz>
Sun, 14 Dec 2014 16:34:34 +0000 (17:34 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sun, 14 Dec 2014 16:34:34 +0000 (17:34 +0100)
src/input/mpegts/linuxdvb/linuxdvb_satconf.c
src/input/mpegts/linuxdvb/linuxdvb_switch.c

index a774d3e5148a77a4d583f7f21ba8ed35fb2dfb29..971482f9be79533f6de4968d8438ea37a99742f9 100644 (file)
@@ -664,7 +664,7 @@ static void linuxdvb_satconf_ele_tune_cb ( void *o );
 static int
 linuxdvb_satconf_ele_tune ( linuxdvb_satconf_ele_t *lse )
 {
-  int r, i, b;
+  int r, i, b, pol;
   uint32_t f;
   linuxdvb_satconf_t *ls = lse->lse_parent;
 
@@ -724,6 +724,24 @@ linuxdvb_satconf_ele_tune ( linuxdvb_satconf_ele_t *lse )
     ls->ls_orbital_dir = 0;
   }
 
+  /* LNB settings */
+  pol  = (lse->lse_lnb) ? lse->lse_lnb->lnb_pol (lse->lse_lnb, lm) & 0x1 : 0;
+
+  if (ls->ls_diseqc_full || ls->ls_last_pol != pol + 1) {
+
+    ls->ls_last_pol = 0;
+
+    /* EN50494 devices have another mechanism to select polarization */
+    if (!lse->lse_en50494) {
+
+      /* Set the voltage */
+      if (linuxdvb_diseqc_set_volt(lfe->lfe_fe_fd, pol))
+        return -1;
+
+      ls->ls_last_pol = pol + 1;
+    }
+  }
+
   /* Set the tone (en50494 don't use tone) */
   if (!lse->lse_en50494) {
     ls->ls_last_tone_off = 0;
index 35d6ff1652be577810104f523d275880c1701146..0c73989d57b308ef5179549e4f24a0564c902d98 100644 (file)
@@ -151,27 +151,11 @@ linuxdvb_switch_tune
   linuxdvb_switch_t *ls = (linuxdvb_switch_t*)ld;
   linuxdvb_satconf_t *lsp = sc->lse_parent;
 
-  /* LNB settings */
-  pol  = (sc->lse_lnb) ? sc->lse_lnb->lnb_pol (sc->lse_lnb, lm) & 0x1 : 0;
-
-  if (lsp->ls_diseqc_full || lsp->ls_last_pol != pol + 1) {
-
-    lsp->ls_last_pol = 0;
-
-    /* EN50494 devices have another mechanism to select polarization */
-    if (!sc->lse_en50494) {
-      /* Set the voltage */
-      if (linuxdvb_diseqc_set_volt(fd, pol))
-        return -1;
-
-      lsp->ls_last_pol = pol + 1;
-    }
-  }
-
   if (lsp->ls_diseqc_full || lsp->ls_last_switch != sc) {
 
     lsp->ls_last_switch = NULL;
 
+    pol  = (sc->lse_lnb) ? sc->lse_lnb->lnb_pol (sc->lse_lnb, lm) & 0x1 : 0;
     band = (sc->lse_lnb) ? sc->lse_lnb->lnb_band(sc->lse_lnb, lm) & 0x1 : 0;
     com  = 0xF0 | (ls->ls_committed << 2) | (pol << 1) | band;