]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
linuxdvb rotor: Add Min Rotor Move
authorJaroslav Kysela <perex@perex.cz>
Thu, 18 Dec 2014 08:04:46 +0000 (09:04 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 18 Dec 2014 08:04:46 +0000 (09:04 +0100)
src/input/mpegts/linuxdvb/linuxdvb_private.h
src/input/mpegts/linuxdvb/linuxdvb_rotor.c
src/input/mpegts/linuxdvb/linuxdvb_satconf.c

index dd6fe48a4e4db80ad0f9d46d19bcaba6bdb71f77..c085d1b4b9967dc87689091b0243bc64fe3e50da 100644 (file)
@@ -145,6 +145,7 @@ struct linuxdvb_satconf
    */
   int                    ls_lnb_poweroff;
   uint32_t               ls_max_rotor_move;
+  uint32_t               ls_min_rotor_move;
   double                 ls_site_lat;
   double                 ls_site_lon;
   uint32_t               ls_motor_rate;
index ef1effc47c8ade7106e16c9ebebe73314c318cfd..adbb85202262b02e727acf2ff5ce633684c66b4a 100644 (file)
@@ -294,7 +294,7 @@ linuxdvb_rotor_grace
 {
   linuxdvb_rotor_t *lr = (linuxdvb_rotor_t*)ld;
   linuxdvb_satconf_t *ls = ld->ld_satconf->lse_parent;
-  int newpos, delta, tunit;
+  int newpos, delta, tunit, min, res;
 
   if (!ls->ls_last_orbital_pos || ls->ls_motor_rate == 0)
     return ls->ls_max_rotor_move;
@@ -310,7 +310,13 @@ linuxdvb_rotor_grace
     return 0;
 
   /* add one extra second, because of the rounding issue */
-  return ((ls->ls_motor_rate*delta+(tunit-1))/tunit) + 1;
+  res = ((ls->ls_motor_rate*delta+(tunit-1))/tunit) + 1;
+
+  min = 1 + ls->ls_min_rotor_move;
+  if (res < min)
+    res = min;
+
+  return res;
 }
 
 static int
index 6224ba16f06ee03fe5052c6309c60bbaab304cb3..9a68b2cc8f998860e1c9851ef21b6422494cb4d3 100644 (file)
@@ -253,6 +253,13 @@ const idclass_t linuxdvb_satconf_class =
       .opts     = PO_ADVANCED,
       .def.u32  = 120
     },
+    {
+      .type     = PT_U32,
+      .id       = "min_rotor_move",
+      .name     = "Min Rotor Time (seconds)",
+      .off      = offsetof(linuxdvb_satconf_t, ls_min_rotor_move),
+      .opts     = PO_ADVANCED,
+    },
     {
       .type     = PT_DBL,
       .id       = "site_lat",