]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
capmt: fixed obvious bug - wrong condition - this causes many 'Do you have OSCAM... v4.0.7
authorJaroslav Kysela <perex@perex.cz>
Wed, 21 Oct 2015 10:47:09 +0000 (12:47 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 22 Oct 2015 19:13:23 +0000 (21:13 +0200)
src/descrambler/capmt.c

index b3f920779196e36967fa775f1b56e2767558a4de..8eecff21551a3fdcb908a86bc06e5f9ce81a7dbc 100644 (file)
@@ -496,7 +496,7 @@ capmt_connect(capmt_t *capmt, int i)
 
   }
 
-  if (fd) {
+  if (fd >= 0) {
     tvhlog(LOG_DEBUG, "capmt", "%s: Created socket %d", capmt_name(capmt), fd);
     capmt->capmt_sock[i] = fd;
     capmt->capmt_sock_reconnect[i]++;
@@ -753,18 +753,16 @@ capmt_send_stop(capmt_service_t *t)
 static void
 capmt_send_stop_descrambling(capmt_t *capmt)
 {
-  uint8_t buf[8];
-
-  buf[0] = 0x9F;
-  buf[1] = 0x80;
-  buf[2] = 0x3F;
-  buf[3] = 0x04;
-
-  buf[4] = 0x83;
-  buf[5] = 0x02;
-  buf[6] = 0x00;
-  buf[7] = 0xFF; //wildcard demux id
-
+  static uint8_t buf[8] = {
+    0x9F,
+    0x80,
+    0x3F,
+    0x04,
+    0x83,
+    0x02,
+    0x00,
+    0xFF, /* wildcard demux id */
+  };
   capmt_write_msg(capmt, 0, 0, buf, 8);
 }