Commit 9a6b8414 authored by François Cartegnie's avatar François Cartegnie 🤞

demux: dash: add missing periods baseUrl

parent 6894028e
......@@ -111,6 +111,10 @@ void IsoffMainParser::parsePeriods(Node *root)
period->duration.Set(IsoTime((*it)->getAttributeValue("duration")));
if((*it)->hasAttribute("id"))
period->setId((*it)->getAttributeValue("id"));
std::vector<Node *> baseUrls = DOMHelper::getChildElementByTagName(*it, "BaseURL");
if(!baseUrls.empty())
period->baseUrl.Set( new Url( baseUrls.front()->getText() ) );
setAdaptationSets(*it, period);
mpd->addPeriod(period);
}
......
......@@ -39,11 +39,13 @@ Period::Period(MPD *mpd) :
{
duration.Set(0);
startTime.Set(0);
baseUrl.Set(NULL);
}
Period::~Period ()
{
vlc_delete_all( this->adaptationSets );
delete baseUrl.Get();
childs.clear();
}
......@@ -86,7 +88,10 @@ AdaptationSet * Period::getAdaptationSet(Streams::Type type) const
Url Period::getUrlSegment() const
{
return getParentUrlSegment();
if( baseUrl.Get() )
return *(baseUrl.Get());
else
return getParentUrlSegment();
}
std::vector<std::string> Period::toString(int indent) const
......
......@@ -55,6 +55,7 @@ namespace dash
virtual Url getUrlSegment() const; /* reimpl */
virtual mtime_t getPeriodStart() const; /* reimpl */
Property<Url *> baseUrl;
Property<mtime_t> duration;
Property<mtime_t> startTime;
......
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