]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
linuxdvb: satconf - cleanups for the rotor external command
authorJaroslav Kysela <perex@perex.cz>
Wed, 19 Dec 2018 14:28:35 +0000 (15:28 +0100)
committerJaroslav Kysela <perex@perex.cz>
Wed, 19 Dec 2018 14:28:35 +0000 (15:28 +0100)
src/input/mpegts/linuxdvb/linuxdvb_private.h
src/input/mpegts/linuxdvb/linuxdvb_rotor.c
src/input/mpegts/linuxdvb/linuxdvb_satconf.c

index b51d3215c43e2d5b87e474af593b5fdbf7e008c7..d78d963ecabdea59b5e53dfcd3bce51c66fb3f50 100644 (file)
@@ -268,6 +268,7 @@ struct linuxdvb_satconf
   int                    ls_site_lat_south;
   int                    ls_site_lon_west;
   int                    ls_site_altitude;
+  char                  *ls_rotor_extcmd;
   
   /*
    * Satconf elements
@@ -282,7 +283,6 @@ struct linuxdvb_satconf
   int                    ls_last_tone_off;
   int                    ls_last_orbital_pos;
   int                    ls_last_queued_pos;
-  char                   *ls_external_cmd;
 };
 
 /*
index b773aa0c70ce1707f8fa792a4e8612e9e3966d15..89df93b4e84b2e3773a9544422f3717f36164bf5 100644 (file)
@@ -342,7 +342,7 @@ sat_angle( linuxdvb_rotor_t *lr, linuxdvb_satconf_ele_t *ls )
  * *************************************************************************/
 
 static int
-linuxdvb_external_command
+linuxdvb_rotor_extcmd
   (linuxdvb_rotor_t *lr, linuxdvb_satconf_t *ls)
 {
   int outlen = -1, rd = -1;
@@ -352,7 +352,7 @@ linuxdvb_external_command
   int ret = -1;
 
   snprintf(num, sizeof(num), "%u", lr->lr_position);
-  if (spawn_and_give_stdout(ls->ls_external_cmd, argv, NULL, &rd, NULL, 1) >= 0) {
+  if (spawn_and_give_stdout(ls->ls_rotor_extcmd, argv, NULL, &rd, NULL, 1) >= 0) {
     outlen = read(rd, outbuf, 99);
     if (outlen>0) {
       outbuf[outlen]=0;
@@ -370,7 +370,7 @@ linuxdvb_external_command
   }
   if (rd>=0)
     close(rd);
-  tvhinfo(LS_DISEQC, "linuxdvb_external_command moving to %d returned %d", lr->lr_position, ret);
+  tvhinfo(LS_DISEQC, "linuxdvb_rotor_extcmd moving to %d returned %d", lr->lr_position, ret);
   return ret;
 }
 
@@ -378,7 +378,7 @@ static int
 linuxdvb_external_grace
   ( linuxdvb_rotor_t *lr, linuxdvb_satconf_t *ls)
 {
-  int ret=linuxdvb_external_command(lr, ls);
+  int ret = linuxdvb_rotor_extcmd(lr, ls);
   if (ret<0)
     return ls->ls_max_rotor_move;
   return ret;
@@ -393,7 +393,7 @@ linuxdvb_rotor_grace
   int newpos, delta, tunit, min, res;
 
   if (idnode_is_instance(&lr->ld_id, &linuxdvb_rotor_external_class))
-      return linuxdvb_external_grace(lr, ls);
+    return linuxdvb_external_grace(lr, ls);
 
   if (!ls->ls_last_orbital_pos || ls->ls_motor_rate == 0)
     return ls->ls_max_rotor_move;
@@ -469,7 +469,7 @@ linuxdvb_rotor_external_tune
   ( linuxdvb_rotor_t *lr, dvb_mux_t *lm,
     linuxdvb_satconf_t *lsp, linuxdvb_satconf_ele_t *ls )
 {
-  return linuxdvb_external_command(lr, lsp);
+  return linuxdvb_rotor_extcmd(lr, lsp);
 }
 
 /* USALS */
index bf818e4744a54219833f7bc893e401817e876781..966345f7136d65e718979a860cce377b15e3b936 100644 (file)
@@ -759,9 +759,9 @@ const idclass_t linuxdvb_satconf_advanced_class =
     {
       .type     = PT_STR,
       .id       = "external_cmd",
-      .name     = N_("External command"),
-      .desc     = N_("Command to move the dish with rotor external."),
-      .off      = offsetof(linuxdvb_satconf_t, ls_external_cmd),
+      .name     = N_("External rotor command"),
+      .desc     = N_("Command to move the dish with an external command."),
+      .off      = offsetof(linuxdvb_satconf_t, ls_rotor_extcmd),
       .opts     = PO_ADVANCED,
       .def.i    = 0
     },
@@ -1685,6 +1685,7 @@ linuxdvb_satconf_destroy ( linuxdvb_satconf_t *ls, int delconf )
   }
   idnode_save_check(&ls->ls_id, 1);
   idnode_unlink(&ls->ls_id);
+  free(ls->ls_rotor_extcmd);
   free(ls);
 }