Skip to content

Commit f03248c

Browse files
author
Anurag Krishnan
committed
VPLAY-11854 Webprocess crash AampDRMLicenseManager::createDrmSession
Reason for change: trigger the fake tune only when the device transitions from DEEPSLEEP to ON/STANDBY, we can make sure that HDMI is in the expected state and the playback should work as expected. Test Procedure: updated in ticket Risks: Low Signed-off-by: Anurag Krishnan <[email protected]>
1 parent d3b4447 commit f03248c

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

middleware/externals/rdk/PlayerExternalsRdkInterface.cpp

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#define RETRYSLEEP (300 * 1000) //Retry sleep
3939

4040
#ifdef USE_PREINIT_DECODING
41+
static IARM_Bus_PWRMgr_PowerState_t prevState;
4142
static void IARM_PowerChangeHandler (const PowerController_PowerState_t currentState,
4243
const PowerController_PowerState_t newState, void* userdata);
4344
#endif
@@ -100,6 +101,21 @@ void getPwrContInterface()
100101
}
101102
usleep(RETRYSLEEP); // 300ms
102103
}
104+
105+
IARM_Bus_PWRMgr_PowerState_t curState;
106+
if (IARM_Bus_Call(IARM_BUS_PWRMGR_NAME,
107+
IARM_BUS_PWRMGR_API_GetPowerState,
108+
&curState,
109+
sizeof(curState)) == IARM_RESULT_SUCCESS)
110+
{
111+
prevState = curState;
112+
MW_LOG_INFO("Initialized prevState = %d", prevState);
113+
}
114+
else {
115+
prevState = IARM_BUS_PWRMGR_POWERSTATE_ON; // fallback
116+
MW_LOG_ERR("Failed to get current power state, defaulting to ON");
117+
}
118+
103119
MW_LOG_INFO("Registering power mode change callback...");
104120
PowerController_RegisterPowerModeChangedCallback(IARM_PowerChangeHandler, nullptr);
105121

@@ -143,12 +159,16 @@ static void IARM_PowerChangeHandler (const PowerController_PowerState_t currentS
143159
{
144160
MW_LOG_INFO("Entering IARM_PowerChangeHandler:State Changed currentState: %d, newState: %d",
145161
currentState, newState);
162+
163+
bool isOnOrStandby = (newState == IARM_BUS_PWRMGR_POWERSTATE_ON || newState == IARM_BUS_PWRMGR_POWERSTATE_STANDBY);
146164

147-
if(currentState == POWER_STATE_STANDBY_DEEP_SLEEP && newState != POWER_STATE_STANDBY_DEEP_SLEEP )
165+
if((currentState == POWER_STATE_STANDBY_DEEP_SLEEP && isOnOrStandby) ||
166+
(prevState == IARM_BUS_PWRMGR_POWERSTATE_STANDBY_DEEP_SLEEP && curState == IARM_BUS_PWRMGR_POWERSTATE_STANDBY_LIGHT_SLEEP && isOnOrStandby) )
148167
{
149168
MW_LOG_INFO(" DEEPSLEEP : calling triggerFakeTune \n");
150169
triggerFakeTune();
151170
}
171+
prevState = currentState;
152172

153173
MW_LOG_INFO("Exiting IARM_PowerChangeHandler..");
154174
}

0 commit comments

Comments
 (0)