From 2b16fcbf657437c227bb48b0d5c3b0b3f7d0d5bb Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 1 Nov 2018 14:25:25 +0100 Subject: [PATCH] linuxdvb: set volt - tiny optimization --- src/input/mpegts/linuxdvb/linuxdvb_satconf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.47.3