Skip to content

Commit

Permalink
[DashTree] Removed clearkey KID workaround
Browse files Browse the repository at this point in the history
its now taken from mp4box
  • Loading branch information
CastagnaIT committed Aug 27, 2024
1 parent 25f92b1 commit e1690f5
Showing 1 changed file with 0 additions and 44 deletions.
44 changes: 0 additions & 44 deletions src/parser/DASHTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "PRProtectionParser.h"
#include "SrvBroker.h"
#include "common/Period.h"
#include "decrypters/Helpers.h"
#include "utils/Base64Utils.h"
#include "utils/CurlUtils.h"
#include "utils/StringUtils.h"
Expand Down Expand Up @@ -1337,49 +1336,6 @@ bool adaptive::CDashTree::GetProtectionData(
}
}

// Workaround for ClearKey:
// if license type ClearKey is set and a manifest dont contains ClearKey protection scheme
// in any case the KID is required to allow decryption (with clear keys or license URLs provided by Kodi props)
//! @todo: this should not be a task of parser, moreover missing an appropriate KID extraction from mp4 box
auto& kodiProps = CSrvBroker::GetKodiProps();
ProtectionScheme ckProtScheme;
if (kodiProps.GetLicenseType() == DRM::KS_CLEARKEY)
{
std::string_view defaultKid;
if (protSelected)
defaultKid = protSelected->kid;
if (defaultKid.empty() && protCommon)
defaultKid = protCommon->kid;

if (defaultKid.empty())
{
for (const ProtectionScheme& protScheme : reprProtSchemes)
{
if (!protScheme.kid.empty())
{
defaultKid = protScheme.kid;
break;
}
}
if (defaultKid.empty())
{
for (const ProtectionScheme& protScheme : adpProtSchemes)
{
if (!protScheme.kid.empty())
{
defaultKid = protScheme.kid;
break;
}
}
}
if (protCommon)
ckProtScheme = *protCommon;

ckProtScheme.kid = defaultKid;
protCommon = &ckProtScheme;
}
}

bool isEncrypted{false};
std::string selectedKid;
std::string selectedPssh;
Expand Down

0 comments on commit e1690f5

Please sign in to comment.