Commit 4ee2be1f authored by François Cartegnie's avatar François Cartegnie 🤞

demux: hls: set non default ID on adaptsets

parent 2ca6b3e4
...@@ -214,7 +214,7 @@ size_t IsoffMainParser::parseSegmentInformation(Node *node, SegmentInformation * ...@@ -214,7 +214,7 @@ size_t IsoffMainParser::parseSegmentInformation(Node *node, SegmentInformation *
info->setTimescale(Integer<uint64_t>(node->getAttributeValue("timescale"))); info->setTimescale(Integer<uint64_t>(node->getAttributeValue("timescale")));
if(node->hasAttribute("id")) if(node->hasAttribute("id"))
info->setID(node->getAttributeValue("id")); info->setID(ID(node->getAttributeValue("id")));
else else
info->setID(ID((*nextid)++)); info->setID(ID((*nextid)++));
......
...@@ -443,6 +443,7 @@ M3U8 * M3U8Parser::parse(vlc_object_t *p_object, stream_t *p_stream, const std:: ...@@ -443,6 +443,7 @@ M3U8 * M3U8Parser::parse(vlc_object_t *p_object, stream_t *p_stream, const std::
} }
/* Finally add all groups */ /* Finally add all groups */
unsigned set_id = 1;
std::map<std::string, AttributesTag *>::const_iterator groupsit; std::map<std::string, AttributesTag *>::const_iterator groupsit;
for(groupsit = groupsmap.begin(); groupsit != groupsmap.end(); ++groupsit) for(groupsit = groupsmap.begin(); groupsit != groupsmap.end(); ++groupsit)
{ {
...@@ -456,8 +457,22 @@ M3U8 * M3U8Parser::parse(vlc_object_t *p_object, stream_t *p_stream, const std:: ...@@ -456,8 +457,22 @@ M3U8 * M3U8Parser::parse(vlc_object_t *p_object, stream_t *p_stream, const std::
altAdaptSet->addRepresentation(rep); altAdaptSet->addRepresentation(rep);
} }
std::string desc;
if(pair.second->getAttributeByName("GROUP-ID"))
desc = pair.second->getAttributeByName("GROUP-ID")->quotedString();
if(pair.second->getAttributeByName("NAME")) if(pair.second->getAttributeByName("NAME"))
altAdaptSet->description.Set(pair.second->getAttributeByName("NAME")->quotedString()); {
if(!desc.empty())
desc += " ";
desc += pair.second->getAttributeByName("NAME")->quotedString();
}
if(!desc.empty())
{
altAdaptSet->description.Set(desc);
altAdaptSet->setID(ID(desc));
}
else altAdaptSet->setID(ID(set_id++));
/* Subtitles unsupported for now */ /* Subtitles unsupported for now */
if(pair.second->getAttributeByName("TYPE")->value != "AUDIO" && if(pair.second->getAttributeByName("TYPE")->value != "AUDIO" &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment