Commit b45c28ec authored by Francois Cartegnie's avatar Francois Cartegnie

demux: hls: pass language to output

parent b00fc7f3
...@@ -358,6 +358,16 @@ M3U8 * Parser::parse(const std::string &playlisturl) ...@@ -358,6 +358,16 @@ M3U8 * Parser::parse(const std::string &playlisturl)
if(pair.second->getAttributeByName("NAME")) if(pair.second->getAttributeByName("NAME"))
altAdaptSet->description.Set(pair.second->getAttributeByName("NAME")->quotedString()); altAdaptSet->description.Set(pair.second->getAttributeByName("NAME")->quotedString());
if(pair.second->getAttributeByName("LANGUAGE"))
{
std::string lang = pair.second->getAttributeByName("LANGUAGE")->quotedString();
std::size_t pos = lang.find_first_of('-');
if(pos != std::string::npos && pos > 0)
altAdaptSet->addLang(lang.substr(0, pos));
else if (lang.size() < 4)
altAdaptSet->addLang(lang);
}
if(!altAdaptSet->getRepresentations().empty()) if(!altAdaptSet->getRepresentations().empty())
period->addAdaptationSet(altAdaptSet); period->addAdaptationSet(altAdaptSet);
else else
......
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