From: Jaroslav Kysela Date: Thu, 1 Nov 2018 13:25:25 +0000 (+0100) Subject: linuxdvb: set volt - tiny optimization X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b16fcbf657437c227bb48b0d5c3b0b3f7d0d5bb;p=thirdparty%2Ftvheadend.git linuxdvb: set volt - tiny optimization --- diff --git a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c index bb4884bca..52f502b2b 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c @@ -1803,6 +1803,7 @@ linuxdvb_diseqc_send int linuxdvb_diseqc_set_volt ( linuxdvb_satconf_t *ls, int vol ) { + vol = vol < 0 ? -1 : !!(vol > 0); /* Already set ? */ if (vol >= 0 && ls->ls_last_vol == vol + 1) return 0; @@ -1823,7 +1824,7 @@ linuxdvb_diseqc_set_volt ( linuxdvb_satconf_t *ls, int vol ) } if (vol >= 0) tvh_safe_usleep(15000); - ls->ls_last_vol = vol ? (vol < 0 ? 0 : 2) : 1; + ls->ls_last_vol = vol + 1; return 0; }