aboutsummaryrefslogtreecommitdiffstats
path: root/utils/cec-follower/cec-processing.cpp
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2017-08-08 13:52:31 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2017-08-08 15:42:22 +0200
commit82df1903d21bdf08a1ad5e0ab6cc6fa0c9190007 (patch)
tree54090507b275e7ccda0e1552c7f3af9a3cd4ae47 /utils/cec-follower/cec-processing.cpp
parentc88e6ed877a72e21a39271ea851589523326af2c (diff)
cec-follower: use ev.state_change.log_addr_mask
Use ev.state_change.log_addr_mask instead of calling G_LOG_ADDRS. 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.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/utils/cec-follower/cec-processing.cpp b/utils/cec-follower/cec-processing.cpp
index 88ab8286..f1803cd2 100644
--- a/utils/cec-follower/cec-processing.cpp
+++ b/utils/cec-follower/cec-processing.cpp
@@ -1059,10 +1059,14 @@ void testProcessing(struct node *node)
if (ev.event == CEC_EVENT_STATE_CHANGE) {
dev_info("CEC adapter state change.\n");
node->phys_addr = ev.state_change.phys_addr;
- doioctl(node, CEC_ADAP_G_LOG_ADDRS, &laddrs);
- node->adap_la_mask = laddrs.log_addr_mask;
- node->state.active_source_pa = CEC_PHYS_ADDR_INVALID;
- me = laddrs.log_addr[0];
+ node->adap_la_mask = ev.state_change.log_addr_mask;
+ if (node->adap_la_mask) {
+ doioctl(node, CEC_ADAP_G_LOG_ADDRS, &laddrs);
+ me = laddrs.log_addr[0];
+ } else {
+ node->state.active_source_pa = CEC_PHYS_ADDR_INVALID;
+ me = CEC_LOG_ADDR_INVALID;
+ }
memset(la_info, 0, sizeof(la_info));
}
}

Privacy Policy