From 059db72459db86b9a0117819ede6f93be179dc18 Mon Sep 17 00:00:00 2001 From: Xabier Rodriguez-Calvar Date: Tue, 21 Mar 2023 10:27:10 -0700 Subject: [PATCH] Cherry-pick 261925@main (38857c77abb9). https://bugs.webkit.org/show_bug.cgi?id=254215 [GStreamer][Thunder][PlayReady] Insert swapped key id before https://bugs.webkit.org/show_bug.cgi?id=254215 Reviewed by Philippe Normand. We need to insert the swapped key ID before the non swapped one because the original key ID is moved into the store. * Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp: (WebCore::CDMInstanceSessionThunder::keyUpdatedCallback): Canonical link: https://commits.webkit.org/261925@main --- Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp b/Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp index c52b5f6bc682..046416e6c23a 100644 --- a/Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp +++ b/Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp @@ -443,7 +443,7 @@ void CDMInstanceSessionThunder::keyUpdatedCallback(KeyIDType&& keyID) auto keyStatus = status(keyID); GST_DEBUG("updated with with key status %s", toString(keyStatus)); - m_doesKeyStoreNeedMerging |= m_keyStore.add(KeyHandle::create(keyStatus, WTFMove(keyID), BoxPtr(m_session))); + auto instance = cdmInstanceThunder(); if (instance && GStreamerEMEUtilities::isPlayReadyKeySystem(instance->keySystem())) { // PlayReady corner case hack: It happens that the key ID @@ -458,6 +458,8 @@ void CDMInstanceSessionThunder::keyUpdatedCallback(KeyIDType&& keyID) GST_MEMDUMP("updated swapped key", swappedKeyID.data(), swappedKeyID.size()); m_doesKeyStoreNeedMerging |= m_keyStore.add(KeyHandle::create(keyStatus, WTFMove(swappedKeyID), BoxPtr(m_session))); } + + m_doesKeyStoreNeedMerging |= m_keyStore.add(KeyHandle::create(keyStatus, WTFMove(keyID), BoxPtr(m_session))); } void CDMInstanceSessionThunder::keysUpdateDoneCallback()