From 2402edf84d03b322a637b3639a40e1d3bd95f1e9 Mon Sep 17 00:00:00 2001 From: Paul Berberian Date: Mon, 12 Aug 2024 14:04:01 +0200 Subject: [PATCH] Revert "code review" This reverts commit d23ef3ca071ec4a0445f43c6e745bc6853ba81c0. --- src/main_thread/decrypt/content_decryptor.ts | 72 ++++---------------- 1 file changed, 14 insertions(+), 58 deletions(-) diff --git a/src/main_thread/decrypt/content_decryptor.ts b/src/main_thread/decrypt/content_decryptor.ts index b79cc634e9..e6ef8f3b85 100644 --- a/src/main_thread/decrypt/content_decryptor.ts +++ b/src/main_thread/decrypt/content_decryptor.ts @@ -15,6 +15,7 @@ */ import type { IMediaElement } from "../../compat/browser_compatibility_types"; +import { isSafariDesktop } from "../../compat/browser_detection"; import type { ICustomMediaKeys, ICustomMediaKeySystemAccess } from "../../compat/eme"; import eme, { getInitData } from "../../compat/eme"; import config from "../../config"; @@ -730,6 +731,19 @@ export default class ContentDecryptor extends EventEmitter - log.error("DRM: Cannot close the session from the loaded session store"), - ); - } - - /** - * If set, a currently-used key session is already compatible to this - * initialization data. - */ - const compatibleSessionInfo = arrayFind(this._currentSessions, (x) => - x.record.isCompatibleWith(initData), - ); - if (compatibleSessionInfo === undefined) { - return; - } - /** Remove the session from the currentSessions */ - const indexOf = this._currentSessions.indexOf(compatibleSessionInfo); - if (indexOf !== -1) { - log.debug( - "DRM: A session from a processed init is removed due to forceSessionRecreation policy.", - ); - this._currentSessions.splice(indexOf, 1); - } - } - /** * Callback that should be called if an error that made the current * `ContentDecryptor` instance unusable arised.