Skip to content

Commit 9ee5e8f

Browse files
committed
cec: mark the tv as powered up for panasonic once it sends the audiomode request
1 parent f3849e5 commit 9ee5e8f

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

src/lib/implementations/VLCommandHandler.cpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#define VL_POWER_CHANGE 0x20
4242
#define VL_POWERED_UP 0x00
4343
#define VL_POWERED_DOWN 0x01
44+
#define VL_UNKNOWN1 0x06
4445

4546
using namespace CEC;
4647
using namespace PLATFORM;
@@ -90,6 +91,18 @@ int CVLCommandHandler::HandleDeviceVendorCommandWithId(const cec_command &comman
9091
return CEC_ABORT_REASON_INVALID_OPERAND;
9192

9293
if (command.initiator == CECDEVICE_TV &&
94+
command.parameters.At(3) == VL_UNKNOWN1)
95+
{
96+
// set the power up event time
97+
{
98+
CLockObject lock(m_mutex);
99+
if (m_iPowerUpEventReceived == 0)
100+
m_iPowerUpEventReceived = GetTimeMs();
101+
}
102+
// mark the TV as powered on
103+
m_processor->GetTV()->SetPowerStatus(CEC_POWER_STATUS_ON);
104+
}
105+
else if (command.initiator == CECDEVICE_TV &&
93106
command.destination == CECDEVICE_BROADCAST &&
94107
command.parameters.At(3) == VL_POWER_CHANGE)
95108
{
@@ -195,3 +208,20 @@ bool CVLCommandHandler::SourceSwitchAllowed(void)
195208
{
196209
return PowerUpEventReceived();
197210
}
211+
212+
int CVLCommandHandler::HandleSystemAudioModeRequest(const cec_command &command)
213+
{
214+
if (command.initiator == CECDEVICE_TV)
215+
{
216+
// set the power up event time
217+
{
218+
CLockObject lock(m_mutex);
219+
if (m_iPowerUpEventReceived == 0)
220+
m_iPowerUpEventReceived = GetTimeMs();
221+
}
222+
// mark the TV as powered on
223+
m_processor->GetTV()->SetPowerStatus(CEC_POWER_STATUS_ON);
224+
}
225+
226+
return CCECCommandHandler::HandleSystemAudioModeRequest(command);
227+
}

src/lib/implementations/VLCommandHandler.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ namespace CEC
4545

4646
int HandleDeviceVendorCommandWithId(const cec_command &command);
4747
int HandleStandby(const cec_command &command);
48+
int HandleSystemAudioModeRequest(const cec_command &command);
4849

4950
int HandleVendorCommand(const cec_command &command);
5051
bool PowerUpEventReceived(void);

0 commit comments

Comments
 (0)