Skip to content

Commit

Permalink
[DASH] Parse cenc:default_KID from kaysystem protection line
Browse files Browse the repository at this point in the history
  • Loading branch information
peak3d committed May 21, 2019
1 parent 50ff9d2 commit 1367f3b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/parser/DASHTree.cpp
Expand Up @@ -191,10 +191,7 @@ bool ParseContentProtection(const char **attr, DASHTree *dash)
if (strcmp((const char*)*(attr + 1), "urn:mpeg:dash:mp4protection:2011") == 0)
mpdFound = true;
else
{
urnFound = stricmp(dash->supportedKeySystem_.c_str(), (const char*)*(attr + 1)) == 0;
break;
}
}
else if (strcmp((const char*)*attr, "cenc:default_KID") == 0)
defaultKID = (const char*)*(attr + 1);
Expand All @@ -204,9 +201,8 @@ bool ParseContentProtection(const char **attr, DASHTree *dash)
{
dash->currentNode_ |= MPDNODE_CONTENTPROTECTION;
dash->encryptionState_ |= DASHTree::ENCRYTIONSTATE_SUPPORTED;
return true;
}
else if (mpdFound && defaultKID && strlen(defaultKID) == 36)
if ((urnFound || mpdFound) && defaultKID && strlen(defaultKID) == 36)
{
dash->current_defaultKID_.resize(16);
for (unsigned int i(0); i < 16; ++i)
Expand All @@ -218,7 +214,7 @@ bool ParseContentProtection(const char **attr, DASHTree *dash)
}
}
// Return if we have URN or not
return !mpdFound;
return urnFound || !mpdFound;
}

/*----------------------------------------------------------------------
Expand Down

0 comments on commit 1367f3b

Please sign in to comment.