SERXIONE-8617 Fix crash in AAMPGstPlayer::Pause when receiving EAS alert#1452
Draft
jfagunde wants to merge 3 commits into
Draft
SERXIONE-8617 Fix crash in AAMPGstPlayer::Pause when receiving EAS alert#1452jfagunde wants to merge 3 commits into
jfagunde wants to merge 3 commits into
Conversation
Reason for Change: Fix crash in AAMPGstPlayer::Pause Summary of Changes: - Add protection against null playerInstance to AAMPGstPlayer::Pause - Lock sync mutex in AAMPGstPlayer::Stop - Test changes in L1 tests - Add mocks for SyncBegin and SyncEnd Test Procedure: Send EAS alerts and confirm there is no crash Priority: P0 Risks: Low
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses an AAMPGstPlayer crash path around pause/stop handling during EAS alert scenarios by adding synchronization around stop and null handling around pause, plus related L1 test support.
Changes:
- Adds
SyncBegin/SyncEndcalls aroundAAMPGstPlayer::Stop. - Guards
AAMPGstPlayer::Pauseagainst a nullplayerInstance. - Adds AAMPGstPlayer tests and mock/fake support for sync calls.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
aampgstplayer.cpp |
Adds stop synchronization and pause null guard. |
test/utests/tests/AampGstPlayer/FunctionalTests.cpp |
Adds pause null-player and stop-with-pipeline tests. |
test/utests/mocks/MockPrivateInstanceAAMP.h |
Adds mock methods for sync calls. |
test/utests/fakes/FakePrivateInstanceAAMP.cpp |
Forwards fake sync calls to the mock. |
test/utests/tests/StreamAbstractionAAMP_MPD/subtitleTests.cpp |
Changes PrivateInstanceAAMP mock strictness. |
test/utests/tests/StreamAbstractionAAMP_MPD/StreamSelectionTest.cpp |
Changes PrivateInstanceAAMP mock strictness. |
test/utests/tests/StreamAbstractionAAMP_MPD/LinearFOGTests.cpp |
Changes PrivateInstanceAAMP mock strictness. |
test/utests/tests/StreamAbstractionAAMP_MPD/FunctionalTests.cpp |
Changes PrivateInstanceAAMP mock strictness. |
test/utests/tests/StreamAbstractionAAMP_MPD/FetcherLoopTests.cpp |
Changes PrivateInstanceAAMP mock strictness. |
test/utests/tests/StreamAbstractionAAMP_MPD/AudioTrackSwitchTests.cpp |
Changes PrivateInstanceAAMP mock strictness. |
test/utests/tests/StreamAbstractionAAMP_MPD/AudioTrackSelectionTests.cpp |
Changes PrivateInstanceAAMP mock strictness. |
test/utests/tests/StreamAbstractionAAMP_MPD/AudioOnlyTests.cpp |
Changes PrivateInstanceAAMP mock strictness. |
test/utests/tests/FragmentCollectorAdTests/AdSelectionTests.cpp |
Changes PrivateInstanceAAMP mock strictness. |
test/utests/tests/fragmentcollector_mpd/fragmentcollector_mpd1.cpp |
Changes PrivateInstanceAAMP mock strictness. |
test/utests/tests/fragmentcollector_mpd/FindTimedMetadataTests.cpp |
Changes PrivateInstanceAAMP mock strictness. |
| g_mockAampConfig = new NiceMock<MockAampConfig>(); | ||
| mPrivateInstanceAAMP->mIsDefaultOffset = true; | ||
| g_mockPrivateInstanceAAMP = new StrictMock<MockPrivateInstanceAAMP>(); | ||
| g_mockPrivateInstanceAAMP = new NiceMock<MockPrivateInstanceAAMP>(); |
| g_mockAampConfig = new NiceMock<MockAampConfig>(); | ||
| mPrivateInstanceAAMP->mIsDefaultOffset = true; | ||
| g_mockPrivateInstanceAAMP = new StrictMock<MockPrivateInstanceAAMP>(); | ||
| g_mockPrivateInstanceAAMP = new NiceMock<MockPrivateInstanceAAMP>(); |
| mPrivateInstanceAAMP->mIsDefaultOffset = true; | ||
|
|
||
| g_mockPrivateInstanceAAMP = new StrictMock<MockPrivateInstanceAAMP>(); | ||
| g_mockPrivateInstanceAAMP = new NiceMock<MockPrivateInstanceAAMP>(); |
| mPrivateInstanceAAMP->mIsDefaultOffset = true; | ||
|
|
||
| g_mockPrivateInstanceAAMP = new StrictMock<MockPrivateInstanceAAMP>(); | ||
| g_mockPrivateInstanceAAMP = new NiceMock<MockPrivateInstanceAAMP>(); |
| g_mockAampGstPlayer = new MockAAMPGstPlayer(mPrivateInstanceAAMP); | ||
| mPrivateInstanceAAMP->mIsDefaultOffset = true; | ||
| g_mockPrivateInstanceAAMP = new StrictMock<MockPrivateInstanceAAMP>(); | ||
| g_mockPrivateInstanceAAMP = new NiceMock<MockPrivateInstanceAAMP>(); |
| mPrivateInstanceAAMP->mIsDefaultOffset = true; | ||
|
|
||
| g_mockPrivateInstanceAAMP = new StrictMock<MockPrivateInstanceAAMP>(); | ||
| g_mockPrivateInstanceAAMP = new NiceMock<MockPrivateInstanceAAMP>(); |
| g_mockAampGstPlayer = new MockAAMPGstPlayer(mPrivateInstanceAAMP); | ||
|
|
||
| g_mockPrivateInstanceAAMP = new StrictMock<MockPrivateInstanceAAMP>(); | ||
| g_mockPrivateInstanceAAMP = new NiceMock<MockPrivateInstanceAAMP>(); |
| mPrivateInstanceAAMP->mIsDefaultOffset = true; | ||
|
|
||
| g_mockPrivateInstanceAAMP = new StrictMock<MockPrivateInstanceAAMP>(); | ||
| g_mockPrivateInstanceAAMP = new NiceMock<MockPrivateInstanceAAMP>(); |
| mPrivateInstanceAAMP = new PrivateInstanceAAMP(gpGlobalConfig); | ||
|
|
||
| g_mockPrivateInstanceAAMP = new StrictMock<MockPrivateInstanceAAMP>(); | ||
| g_mockPrivateInstanceAAMP = new NiceMock<MockPrivateInstanceAAMP>(); |
| mPrivateInstanceAAMP = new PrivateInstanceAAMP(gpGlobalConfig); | ||
|
|
||
| g_mockPrivateInstanceAAMP = new StrictMock<MockPrivateInstanceAAMP>(); | ||
| g_mockPrivateInstanceAAMP = new NiceMock<MockPrivateInstanceAAMP>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reason for Change: Fix crash in AAMPGstPlayer::Pause
Summary of Changes:
Test Procedure: Send EAS alerts and confirm there is no crash
Priority: P0
Risks: Low