From 9ce0c5542d0396b9a62c8c45e1798e9e1bccac15 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 12 Dec 2014 19:00:18 +0100 Subject: [PATCH] linuxdvb rotor: small cleanups --- src/input/mpegts/linuxdvb/linuxdvb_rotor.c | 8 +++++--- src/input/mpegts/linuxdvb/linuxdvb_satconf.c | 9 ++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/input/mpegts/linuxdvb/linuxdvb_rotor.c b/src/input/mpegts/linuxdvb/linuxdvb_rotor.c index a055ec13..6f5bcbc0 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_rotor.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_rotor.c @@ -177,17 +177,19 @@ static int linuxdvb_rotor_check_orbital_pos ( dvb_mux_t *lm, linuxdvb_satconf_ele_t *ls ) { + linuxdvb_satconf_t *lsp; int pos; char dir; - if (dvb_network_get_orbital_pos(lm->mm_network, &pos, &dir) < 0) return 0; - if (dir != ls->lse_parent->ls_orbital_dir) + lsp = ls->lse_parent; + + if (dir != lsp->ls_orbital_dir) return 0; - if (abs(pos - ls->lse_parent->ls_orbital_pos) > 2) + if (abs(pos - lsp->ls_orbital_pos) > 2) return 0; tvhdebug("diseqc", "rotor already positioned to %i.%i%c", diff --git a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c index 47291a56..df8ec774 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c @@ -670,9 +670,12 @@ linuxdvb_satconf_ele_tune ( linuxdvb_satconf_ele_t *lse ) } /* Remember the last network position for rotor */ - dvb_network_get_orbital_pos(lm->mm_network, - &lse->lse_parent->ls_orbital_pos, - &lse->lse_parent->ls_orbital_dir); + if (dvb_network_get_orbital_pos(lm->mm_network, + &ls->ls_orbital_pos, + &ls->ls_orbital_dir) < 0) { + ls->ls_orbital_pos = 0; + ls->ls_orbital_dir = 0; + } /* Set the tone (en50494 don't use tone) */ if (!lse->lse_en50494) {