Skip to content

Commit a017bf7

Browse files
authored
VPLAY-11062 Bring back with L2 & L3 fixes
VPLAY-11062 Bring back with L2 & L3 fixes This reverts commit 546df9a. Reason for change: During detach(), set the EventManager state to RELEASED to disable further event processing. When reusing a previously detached player, reset the EventManager state to IDLE to re-enable event handling. Test Procedure: Refer Jira Risks: Low Signed-off-by: psiva01 <[email protected]>
1 parent 4073eea commit a017bf7

File tree

5 files changed

+56
-0
lines changed

5 files changed

+56
-0
lines changed

main_aamp.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,10 @@ void PlayerInstanceAAMP::SetRateInternal(float rate,int overshootcorrection)
622622

623623
if (aamp->mpStreamAbstractionAAMP && !(aamp->mbUsingExternalPlayer))
624624
{
625+
if (aamp->mbDetached)
626+
{
627+
aamp->enableEventProcessing();
628+
}
625629
if ( AAMP_SLOWMOTION_RATE != rate && !aamp->mIsIframeTrackPresent && rate != AAMP_NORMAL_PLAY_RATE && rate != 0 && aamp->mMediaFormat != eMEDIAFORMAT_PROGRESSIVE)
626630
{
627631
AAMPLOG_WARN("Ignoring trickplay. No iframe tracks in stream");
@@ -1093,6 +1097,11 @@ void PlayerInstanceAAMP::SeekInternal(double secondsRelativeToTuneTime, bool kee
10931097
AAMPPlayerState state = GetState();
10941098
aamp->StopPausePositionMonitoring("Seek() called");
10951099

1100+
if (aamp->mbDetached)
1101+
{
1102+
aamp->enableEventProcessing();
1103+
}
1104+
10961105
if ((aamp->mMediaFormat == eMEDIAFORMAT_HLS || aamp->mMediaFormat == eMEDIAFORMAT_HLS_MP4) && (eSTATE_INITIALIZING == state) && aamp->mpStreamAbstractionAAMP)
10971106
{
10981107
AAMPLOG_WARN("aamp_Seek(%f) at the middle of tune, no fragments downloaded yet.state(%d), keep paused(%d)", secondsRelativeToTuneTime, state, keepPaused);

priv_aamp.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6714,6 +6714,24 @@ bool PrivateInstanceAAMP::IsPlayEnabled()
67146714
return mbPlayEnabled;
67156715
}
67166716

6717+
/**
6718+
* @brief Enable event processing
6719+
*/
6720+
void PrivateInstanceAAMP::enableEventProcessing()
6721+
{
6722+
// Reset Event Manager State to IDLE to resume event processing
6723+
mEventManager->SetPlayerState(eSTATE_IDLE);
6724+
}
6725+
6726+
/**
6727+
* @brief Disable event processing
6728+
*/
6729+
void PrivateInstanceAAMP::disableEventProcessing()
6730+
{
6731+
// Set Event Manager State to RELEASED to avoid further event processing
6732+
mEventManager->SetPlayerState(eSTATE_RELEASED);
6733+
}
6734+
67176735
/**
67186736
* @brief Soft stop the player instance.
67196737
*
@@ -6752,6 +6770,7 @@ void PrivateInstanceAAMP::detach()
67526770
mbDetached=true;
67536771
mPlayerPreBuffered = false;
67546772
mTelemetryInterval = 0;
6773+
disableEventProcessing();
67556774
//EnableDownloads();// enable downloads
67566775
}
67576776
else

priv_aamp.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3043,6 +3043,18 @@ class PrivateInstanceAAMP : public DrmCallbacks, public std::enable_shared_from_
30433043
*/
30443044
bool IsPlayEnabled();
30453045

3046+
/**
3047+
* @fn enableEventProcessing
3048+
*
3049+
* @return void
3050+
*/
3051+
void enableEventProcessing();
3052+
/**
3053+
* @fn disableEventProcessing
3054+
*
3055+
* @return void
3056+
*/
3057+
void disableEventProcessing();
30463058
/**
30473059
* @fn detach
30483060
*

test/utests/drm/mocks/aampMocks.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,14 @@ void PrivateInstanceAAMP::Tune(const char *mainManifestUrl, bool autoPlay, const
243243
mFogTSBEnabled = strcasestr(mainManifestUrl, "tsb?");
244244
}
245245

246+
void PrivateInstanceAAMP::enableEventProcessing()
247+
{
248+
}
249+
250+
void PrivateInstanceAAMP::disableEventProcessing()
251+
{
252+
}
253+
246254
void PrivateInstanceAAMP::detach()
247255
{
248256
}

test/utests/fakes/FakePrivateInstanceAAMP.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,14 @@ void PrivateInstanceAAMP::Tune(const char *mainManifestUrl,
255255
mFogTSBEnabled = strcasestr(mainManifestUrl, "tsb?");
256256
}
257257

258+
void PrivateInstanceAAMP::enableEventProcessing()
259+
{
260+
}
261+
262+
void PrivateInstanceAAMP::disableEventProcessing()
263+
{
264+
}
265+
258266
void PrivateInstanceAAMP::detach()
259267
{
260268
}

0 commit comments

Comments
 (0)