Commit 9a6b8414 authored by Francois Cartegnie's avatar Francois Cartegnie

demux: dash: add missing periods baseUrl

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