From: Jaroslav Kysela Date: Wed, 19 Dec 2018 14:28:35 +0000 (+0100) Subject: linuxdvb: satconf - cleanups for the rotor external command X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd37467c8ccac8e0bef1210ae148d630b206605d;p=thirdparty%2Ftvheadend.git linuxdvb: satconf - cleanups for the rotor external command --- diff --git a/src/input/mpegts/linuxdvb/linuxdvb_private.h b/src/input/mpegts/linuxdvb/linuxdvb_private.h index b51d3215c..d78d963ec 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_private.h +++ b/src/input/mpegts/linuxdvb/linuxdvb_private.h @@ -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; }; /* diff --git a/src/input/mpegts/linuxdvb/linuxdvb_rotor.c b/src/input/mpegts/linuxdvb/linuxdvb_rotor.c index b773aa0c7..89df93b4e 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_rotor.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_rotor.c @@ -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 */ diff --git a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c index bf818e474..966345f71 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c @@ -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); }