]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
linuxdvb: set volt - tiny optimization
authorJaroslav Kysela <perex@perex.cz>
Thu, 1 Nov 2018 13:25:25 +0000 (14:25 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 1 Nov 2018 13:25:39 +0000 (14:25 +0100)
src/input/mpegts/linuxdvb/linuxdvb_satconf.c

index bb4884bca686108049187185b6e507aea7da93a1..52f502b2b2d6cc432044105e69725a3b16179b86 100644 (file)
@@ -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;
 }