Commit 40fce919 authored by Francois Cartegnie's avatar Francois Cartegnie

demux: adaptative: parse hls codecs

parent cf3b1cf5
......@@ -28,6 +28,7 @@
#include "../adaptative/playlist/BaseAdaptationSet.h"
#include "../adaptative/playlist/SegmentList.h"
#include "../adaptative/tools/Retrieve.hpp"
#include "../adaptative/tools/Helper.h"
#include "M3U8.hpp"
#include "Tags.hpp"
......@@ -144,8 +145,22 @@ void Parser::parseRepresentation(BaseAdaptationSet *adaptSet, const AttributesTa
if(bwAttr)
rep->setBandwidth(bwAttr->decimal());
if(codecsAttr)
{
std::list<std::string> list = Helper::tokenize(codecsAttr->quotedString(), ',');
std::list<std::string>::const_iterator it;
for(it=list.begin(); it!=list.end(); ++it)
{
std::size_t pos = (*it).find_first_of('.', 0);
if(pos != std::string::npos)
rep->addCodec((*it).substr(0, pos));
else
rep->addCodec(*it);
}
}
/* if more than 1 codec, don't probe, can't be packed audio */
if(codecsAttr && codecsAttr->quotedString().find(',') != std::string::npos)
if(rep->getCodecs().size() > 1)
rep->setMimeType("video/mp2t");
if(resAttr)
......
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