liabarmbox: hdmi_cec return volume in percent, correct msg length

Origin commit data
------------------
Branch: master
Commit: dd77bfac67
Author: TangoCash <eric@loxat.de>
Date: 2018-10-19 (Fri, 19 Oct 2018)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
TangoCash
2018-10-19 16:42:45 +02:00
committed by max_10
parent b1e78594fa
commit a327cbe517

View File

@@ -528,7 +528,7 @@ void hdmi_cec::Receive()
case CEC_OPCODE_REPORT_AUDIO_STATUS: case CEC_OPCODE_REPORT_AUDIO_STATUS:
{ {
muted = ((rxmessage.data[1] & 0x80) == 0x80); muted = ((rxmessage.data[1] & 0x80) == 0x80);
volume = rxmessage.data[1] & 0x7F; volume = ((rxmessage.data[1] & 0x7F) / 127.0) * 100.0;
if (muted) if (muted)
lt_debug("[CEC] %s volume muted\n", ToString((cec_logical_address)rxmessage.initiator)); lt_debug("[CEC] %s volume muted\n", ToString((cec_logical_address)rxmessage.initiator));
else else
@@ -634,8 +634,7 @@ void hdmi_cec::send_key(unsigned char key, unsigned char destination)
txmessage.destination = destination; txmessage.destination = destination;
txmessage.initiator = logicalAddress; txmessage.initiator = logicalAddress;
txmessage.data[0] = CEC_OPCODE_USER_CONTROL_RELEASE; txmessage.data[0] = CEC_OPCODE_USER_CONTROL_RELEASE;
txmessage.data[1] = key; txmessage.length = 1;
txmessage.length = 2;
SendCECMessage(txmessage); SendCECMessage(txmessage);
} }