From 6c5106411ccbf8c14125d112d59cd1deedea0cc2 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 21 Oct 2015 12:47:09 +0200 Subject: [PATCH] capmt: fixed obvious bug - wrong condition - this causes many 'Do you have OSCAM running?' messages --- src/descrambler/capmt.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/descrambler/capmt.c b/src/descrambler/capmt.c index b3f920779..8eecff215 100644 --- a/src/descrambler/capmt.c +++ b/src/descrambler/capmt.c @@ -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); } -- 2.47.3