Skip to content

Commit

Permalink
[AdaptiveTree] Add missing impaired cases to dash/hls
Browse files Browse the repository at this point in the history
  • Loading branch information
CastagnaIT committed Jul 26, 2023
1 parent b3bfc65 commit 11b206b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/parser/DASHTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,8 @@ void adaptive::CDashTree::ParseTagAdaptationSet(pugi::xml_node nodeAdp, PLAYLIST
adpSet->SetIsForced(true);
else if (value == "main")
adpSet->SetIsDefault(true);
else if (value == "caption" || value == "alternate" || value == "commentary")
adpSet->SetIsImpaired(true);
}
}

Expand All @@ -389,7 +391,7 @@ void adaptive::CDashTree::ParseTagAdaptationSet(pugi::xml_node nodeAdp, PLAYLIST

if (schemeIdUri == "urn:mpeg:dash:role:2011")
{
if (value == "caption")
if (STRING::StartsWith(value, "caption")) // caption or captions
adpSet->SetIsImpaired(true);
}
}
Expand Down
11 changes: 11 additions & 0 deletions src/parser/HLSTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,17 @@ bool adaptive::CHLSTree::ParseManifest(const std::string& data)
adpSet->SetIsDefault(attribs["DEFAULT"] == "YES");
adpSet->SetIsForced(attribs["FORCED"] == "YES");

if (STRING::KeyExists(attribs, "CHARACTERISTICS"))
{
std::string ch = attribs["CHARACTERISTICS"];
if (STRING::Contains(ch, "public.accessibility.transcribes-spoken-dialog") ||
STRING::Contains(ch, "public.accessibility.describes-music-and-sound") ||
STRING::Contains(ch, "public.accessibility.describes-video"))
{
adpSet->SetIsImpaired(true);
}
}

repr->AddCodecs(group.m_codecs);
repr->SetTimescale(1000000);

Expand Down

0 comments on commit 11b206b

Please sign in to comment.