aboutsummaryrefslogtreecommitdiffstats
path: root/utils/cec-follower/cec-processing.cpp
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2017-04-27 15:56:16 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2017-04-27 15:56:16 +0200
commit414da92ef4f1e2a48ce480a4640cf283870456c4 (patch)
tree5163fbf6c1d6e1cfe5ff7926ea89c6652bd0898d /utils/cec-follower/cec-processing.cpp
parent09800c44d418df8d2a5e858a75fbd21eb6956cc5 (diff)
cec-follower: make sure we never poll ourselves
Make sure we don't poll ourselves during the period polling code. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Diffstat (limited to 'utils/cec-follower/cec-processing.cpp')
-rw-r--r--utils/cec-follower/cec-processing.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/utils/cec-follower/cec-processing.cpp b/utils/cec-follower/cec-processing.cpp
index 98dbf70b..1e4527bb 100644
--- a/utils/cec-follower/cec-processing.cpp
+++ b/utils/cec-follower/cec-processing.cpp
@@ -1021,7 +1021,7 @@ void testProcessing(struct node *node)
fd_set ex_fds;
int fd = node->fd;
__u32 mode = CEC_MODE_INITIATOR | CEC_MODE_FOLLOWER;
- int me;
+ unsigned me;
unsigned last_poll_la = 15;
doioctl(node, CEC_S_MODE, &mode);
@@ -1104,7 +1104,8 @@ void testProcessing(struct node *node)
__u64 ts_now = get_ts();
unsigned poll_la = ts_to_s(ts_now) % 16;
- if (poll_la != last_poll_la && poll_la < 15 && la_info[poll_la].ts &&
+ if (poll_la != me &&
+ poll_la != last_poll_la && poll_la < 15 && la_info[poll_la].ts &&
ts_to_ms(ts_now - la_info[poll_la].ts) > POLL_PERIOD) {
struct cec_msg msg = {};

Privacy Policy