RDKEMW-19892: [RDKEMW] [BCM Rogers Monarch IUI V2] Linear trick play (FF/RW/Seek) leads to blank screen, device hang, followed by automatic reboot. Multiple critical processes (gmem, WPENetworkProce, WorkerPoolType: etc.) crash were observed.#180
Conversation
…(FF/RW/Seek) leads to blank screen, device hang, followed by automatic reboot. Multiple critical processes (gmem, WPENetworkProce, WorkerPoolType: etc.) crash were observed. Signed-off-by: ALSAMEEMA <alsameema4@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR addresses a Widevine multi-key regression where cenc:default_KID (UUID string form from DASH manifests) was not being matched against 16-byte binary Key IDs parsed from PSSH, leading to wrong-key selection during trick play and downstream failures.
Changes:
- Update
WidevineDrmHelper::setDefaultKeyID()to also accept UUID strings (hyphenated / case variants) by decoding them to 16-byte binary before matching. - Add/adjust fallback + logging behavior in
WidevineDrmHelper::getKey()/setDefaultKeyID(). - Add a new unit-test suite covering default key selection scenarios, including multi-key selection via UUID.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
drm/helper/WidevineDrmHelper.cpp |
Implements UUID-to-binary matching for setDefaultKeyID() and adjusts fallback/logging in key selection. |
test/utests/tests/DrmTests/DrmHelperTests.cpp |
Adds unit tests intended to validate correct default key selection across multiple input formats and key counts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
50390d0 to
fcc2f4d
Compare
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…(FF/RW/Seek) leads to blank screen, device hang, followed by automatic reboot. Multiple critical processes (gmem, WPENetworkProce, WorkerPoolType: etc.) crash were observed.
…(FF/RW/Seek) leads to blank screen, device hang, followed by automatic reboot. Multiple critical processes (gmem, WPENetworkProce, WorkerPoolType: etc.) crash were observed. Signed-off-by: ALSAMEEMA <alsameema4@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| else if (!mKeyIDs.empty()) | ||
| { | ||
| keyID = this->mKeyIDs.at(0); | ||
| MW_LOG_WARN("mDefaultKeySlot(%d) not found in mKeyIDs, falling back to first entry", mDefaultKeySlot); | ||
| keyID = mKeyIDs.begin()->second; | ||
| } |
| std::string keyStr = PlayerLogManager::getHexDebugStr(keyPair.second); | ||
| MW_LOG_DEBUG("Key ID [%d]: %s", keyPair.first, keyStr.c_str()); | ||
| } |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| "edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"); | ||
| std::shared_ptr<DrmHelper> widevineHelper = DrmHelperEngine::getInstance().createHelper(drmInfo); | ||
| ASSERT_NE(widevineHelper, nullptr); | ||
| ASSERT_TRUE(widevineHelper->parsePssh(psshDataPtr, (uint32_t)psshDataLen)); |
| "edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"); | ||
| std::shared_ptr<DrmHelper> widevineHelper = DrmHelperEngine::getInstance().createHelper(drmInfo); | ||
| ASSERT_NE(widevineHelper, nullptr); | ||
| ASSERT_TRUE(widevineHelper->parsePssh(psshDataPtr, (uint32_t)psshDataLen)); |
| ASSERT_TRUE(DrmHelperEngine::getInstance().hasDRM(drmInfo)); | ||
| std::shared_ptr<DrmHelper> widevineHelper = DrmHelperEngine::getInstance().createHelper(drmInfo); | ||
| ASSERT_NE(widevineHelper, nullptr); | ||
| ASSERT_TRUE(widevineHelper->parsePssh(psshDataPtr, (uint32_t)psshDataLen)); |
| "edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"); | ||
| std::shared_ptr<DrmHelper> widevineHelper = DrmHelperEngine::getInstance().createHelper(drmInfo); | ||
| ASSERT_NE(widevineHelper, nullptr); | ||
| ASSERT_TRUE(widevineHelper->parsePssh(psshDataPtr, (uint32_t)psshDataLen)); |
| "edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"); | ||
| std::shared_ptr<DrmHelper> widevineHelper = DrmHelperEngine::getInstance().createHelper(drmInfo); | ||
| ASSERT_NE(widevineHelper, nullptr); | ||
| ASSERT_TRUE(widevineHelper->parsePssh(psshDataPtr, (uint32_t)psshDataLen)); |
| "edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"); | ||
| std::shared_ptr<DrmHelper> widevineHelper = DrmHelperEngine::getInstance().createHelper(drmInfo); | ||
| ASSERT_NE(widevineHelper, nullptr); | ||
| ASSERT_TRUE(widevineHelper->parsePssh(psshDataPtr, (uint32_t)psshDataLen)); |
| @@ -212,22 +250,29 @@ void WidevineDrmHelper::createInitData(std::vector<uint8_t>& initData) const | |||
| void WidevineDrmHelper::getKey(std::vector<uint8_t>& keyID) const | |||
| { | |||
| MW_LOG_WARN("WidevineDrmHelper::getKey defaultkey: %d mKeyIDs.size:%zu", mDefaultKeySlot, mKeyIDs.size()); | |||
| mDefaultKeySlot = it.first; | ||
| MW_LOG_WARN("setDefaultKeyID : %s slot : %d", PlayerLogManager::getHexDebugStr(defaultKeyID).c_str(), mDefaultKeySlot); | ||
| MW_LOG_WARN("setDefaultKeyID : %s slot : %d", PlayerLogManager::getHexDebugStr(it.second).c_str(), mDefaultKeySlot); | ||
| break; |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (6)
test/utests/tests/DrmTests/DrmHelperTests.cpp:623
psshDataPtris freed only at the end of the test, butASSERT_TRUE(parsePssh(...))will abort the test early on failure and skip thefree(), leaking the decode buffer. Free the buffer before asserting by storing the parse result in a local bool (and nulling the pointer so the existing cleanup stays safe).
std::shared_ptr<DrmHelper> widevineHelper = DrmHelperEngine::getInstance().createHelper(drmInfo);
ASSERT_NE(widevineHelper, nullptr);
ASSERT_TRUE(widevineHelper->parsePssh(psshDataPtr, (uint32_t)psshDataLen));
test/utests/tests/DrmTests/DrmHelperTests.cpp:656
psshDataPtris freed only at the end of the test, butASSERT_TRUE(parsePssh(...))will abort early on failure and skip thefree(). Free the decode buffer before asserting to keep this test leak-free even when it fails.
std::shared_ptr<DrmHelper> widevineHelper = DrmHelperEngine::getInstance().createHelper(drmInfo);
ASSERT_NE(widevineHelper, nullptr);
ASSERT_TRUE(widevineHelper->parsePssh(psshDataPtr, (uint32_t)psshDataLen));
test/utests/tests/DrmTests/DrmHelperTests.cpp:709
ASSERT_TRUE(parsePssh(...))can abort the test before the trailingfree(psshDataPtr)runs, leaking the base64 decode buffer when the assertion fails. Prefer freeing immediately after parsing (and null the pointer so the existing cleanup remains safe).
std::shared_ptr<DrmHelper> widevineHelper = DrmHelperEngine::getInstance().createHelper(drmInfo);
ASSERT_NE(widevineHelper, nullptr);
ASSERT_TRUE(widevineHelper->parsePssh(psshDataPtr, (uint32_t)psshDataLen));
test/utests/tests/DrmTests/DrmHelperTests.cpp:772
- This test frees
psshDataPtrat the end, butASSERT_TRUE(parsePssh(...))will return early on failure and skip cleanup. Free the decode buffer before the assertion to avoid leaks in failing runs.
std::shared_ptr<DrmHelper> widevineHelper = DrmHelperEngine::getInstance().createHelper(drmInfo);
ASSERT_NE(widevineHelper, nullptr);
ASSERT_TRUE(widevineHelper->parsePssh(psshDataPtr, (uint32_t)psshDataLen));
test/utests/tests/DrmTests/DrmHelperTests.cpp:823
psshDataPtrcleanup can be skipped ifASSERT_TRUE(parsePssh(...))fails (ASSERT aborts the test). Free the buffer before asserting so this test stays clean under failure/sanitizers.
std::shared_ptr<DrmHelper> widevineHelper = DrmHelperEngine::getInstance().createHelper(drmInfo);
ASSERT_NE(widevineHelper, nullptr);
ASSERT_TRUE(widevineHelper->parsePssh(psshDataPtr, (uint32_t)psshDataLen));
test/utests/tests/DrmTests/DrmHelperTests.cpp:865
- As written,
ASSERT_TRUE(parsePssh(...))can abort the test before the finalfree(psshDataPtr)executes, leaking the decode buffer on failure. FreepsshDataPtrimmediately after parsing and assert on the saved result.
std::shared_ptr<DrmHelper> widevineHelper = DrmHelperEngine::getInstance().createHelper(drmInfo);
ASSERT_NE(widevineHelper, nullptr);
ASSERT_TRUE(widevineHelper->parsePssh(psshDataPtr, (uint32_t)psshDataLen));
No description provided.