Set a unique number to each Session of each Cdm
This commit is contained in:
parent
9191e0258f
commit
838df7c22b
|
@ -131,7 +131,7 @@ class Cdm:
|
|||
if len(self.__sessions) > self.MAX_NUM_OF_SESSIONS:
|
||||
raise TooManySessions(f"Too many Sessions open ({self.MAX_NUM_OF_SESSIONS}).")
|
||||
|
||||
session = Session()
|
||||
session = Session(len(self.__sessions) + 1)
|
||||
self.__sessions[session.id] = session
|
||||
|
||||
return session.id
|
||||
|
|
|
@ -7,7 +7,8 @@ from pywidevine.license_protocol_pb2 import SignedMessage
|
|||
|
||||
|
||||
class Session:
|
||||
def __init__(self):
|
||||
def __init__(self, number: int):
|
||||
self.number = number
|
||||
self.id = get_random_bytes(16)
|
||||
self.service_certificate: Optional[SignedMessage] = None
|
||||
self.context: dict[bytes, tuple[bytes, bytes]] = {}
|
||||
|
|
Loading…
Reference in New Issue