Commit d97111e3 authored by François Cartegnie's avatar François Cartegnie 🤞

demux: hls: handle broken EXTINF

ex: https://livestream.peer5.com/video/kite/index.m3u8
parent c631c341
......@@ -277,9 +277,10 @@ ValuesListTag::~ValuesListTag()
void ValuesListTag::parseAttributes(const std::string &field)
{
std::size_t pos = field.find(',');
Attribute *attr;
if(pos != std::string::npos)
{
Attribute *attr = new (std::nothrow) Attribute("DURATION", field.substr(0, pos));
attr = new (std::nothrow) Attribute("DURATION", field.substr(0, pos));
if(attr)
addAttribute(attr);
......@@ -287,6 +288,12 @@ void ValuesListTag::parseAttributes(const std::string &field)
if(attr)
addAttribute(attr);
}
else /* broken EXTINF without mandatory comma */
{
attr = new (std::nothrow) Attribute("DURATION", field);
if(attr)
addAttribute(attr);
}
}
Tag * TagFactory::createTagByName(const std::string &name, const std::string &value)
......
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