aboutsummaryrefslogtreecommitdiffstats
path: root/utils/cec-compliance/cec-test-audio.cpp
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2019-10-14 14:33:37 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2019-10-14 14:41:19 +0200
commitf87baf65b16328e6bdf8ead57f54ace229caa3c9 (patch)
treef0396669b82f1d309fd8d8ecd9cb7a7f0ddc27a5 /utils/cec-compliance/cec-test-audio.cpp
parentc0cbb2ed061e0d597cea905af98b84114d3c0b05 (diff)
cec-compliance: add timeout to util_receive
util_receive() can currently loop indefinitely if it never gets the expected reply. Add a timeout. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'utils/cec-compliance/cec-test-audio.cpp')
-rw-r--r--utils/cec-compliance/cec-test-audio.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/utils/cec-compliance/cec-test-audio.cpp b/utils/cec-compliance/cec-test-audio.cpp
index 17d6be3e..42b51e0c 100644
--- a/utils/cec-compliance/cec-test-audio.cpp
+++ b/utils/cec-compliance/cec-test-audio.cpp
@@ -619,7 +619,8 @@ static int sac_util_send_user_control_press(struct node *node, unsigned me, unsi
cec_msg_init(&msg, me, la);
cec_msg_user_control_released(&msg);
fail_on_test(!transmit_timeout(node, &msg));
- got_response = util_receive(node, la, &msg, CEC_MSG_USER_CONTROL_PRESSED, CEC_MSG_REPORT_AUDIO_STATUS);
+ got_response = util_receive(node, la, 1000, &msg,
+ CEC_MSG_USER_CONTROL_PRESSED, CEC_MSG_REPORT_AUDIO_STATUS) >= 0;
mode = CEC_MODE_INITIATOR;
doioctl(node, CEC_S_MODE, &mode);

Privacy Policy