aboutsummaryrefslogtreecommitdiffstats
path: root/utils/cec-ctl
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2018-10-04 10:16:55 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2018-10-04 10:16:55 +0200
commit71806d6cbfad009e2b5f5b98ae75dff9eda91bf0 (patch)
tree3ecd96135e7715fd3d80506b57c2709287ba970c /utils/cec-ctl
parent3598047c70e395d8ee0da5519996bc0126f18262 (diff)
cec-ctl: fix destination for non-standard messages
The code that allows for changing the destination between messages broke non-standard messages (poll, vendor messages): they now always used destination 0. Fix this by moving up the code that sets the destination instead of doing setting it in just the default case. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Diffstat (limited to 'utils/cec-ctl')
-rw-r--r--utils/cec-ctl/cec-ctl.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp
index 9b289cb4..10c5b27a 100644
--- a/utils/cec-ctl/cec-ctl.cpp
+++ b/utils/cec-ctl/cec-ctl.cpp
@@ -1797,8 +1797,8 @@ int main(int argc, char **argv)
if (ch == -1)
break;
- if (ch > OptMessages || ch == OptPoll)
- cec_msg_init(&msg, 0, 0);
+ cec_msg_init(&msg, 0, 0);
+ msg.msg[0] = cec_msg_is_broadcast(&msg) ? 0xf : (options[OptTo] ? to : 0xf0);
options[(int)ch] = 1;
switch (ch) {
@@ -2135,7 +2135,6 @@ int main(int argc, char **argv)
break;
opt = opt2message[ch - OptMessages];
parse_msg_args(msg, reply, opt, ch);
- msg.msg[0] = cec_msg_is_broadcast(&msg) ? 0xf : (options[OptTo] ? to : 0xf0);
msgs.push_back(msg);
break;
}

Privacy Policy