]> git.sesse.net Git - vlc/blobdiff - modules/stream_filter/dash/mpd/MPD.cpp
dash: MPD: Removing useless CTOR
[vlc] / modules / stream_filter / dash / mpd / MPD.cpp
index 69b4c05f17433c05e1bb2e4a933a6a4e410fa307..06843daaa7a1dc766b989f9ed68f7472f272e5ea 100644 (file)
@@ -35,10 +35,7 @@ MPD::MPD    (std::map<std::string, std::string> attributes)
     this->attributes    = attributes;
     this->programInfo   = NULL;
 }
-MPD::MPD    ()
-{
 
-}
 MPD::~MPD   ()
 {
     for(size_t i = 0; i < this->periods.size(); i++)
@@ -50,34 +47,41 @@ MPD::~MPD   ()
     delete(this->programInfo);
 }
 
-std::vector<Period*>    MPD::getPeriods             ()
+const std::vector<Period*>&    MPD::getPeriods             () const
 {
     return this->periods;
 }
-std::vector<BaseUrl*>   MPD::getBaseUrls            ()
+
+const std::vector<BaseUrl*>&   MPD::getBaseUrls            () const
 {
     return this->baseUrls;
 }
-std::string             MPD::getMinBufferTime       () throw(AttributeNotPresentException)
+
+const std::string&             MPD::getMinBufferTime       () const throw(AttributeNotPresentException)
 {
-    if(this->attributes.find("minBufferTime") == this->attributes.end())
+    AttributesMap::const_iterator     it = this->attributes.find("minBufferTime");
+    if( it == this->attributes.end())
         throw AttributeNotPresentException();
 
-    return this->attributes["minBufferTime"];
+    return it->second;
 }
-std::string             MPD::getType                () throw(AttributeNotPresentException)
+
+const std::string&             MPD::getType                () const throw(AttributeNotPresentException)
 {
-    if(this->attributes.find("type") == this->attributes.end())
+    AttributesMap::const_iterator     it = this->attributes.find( "type" );
+    if( it == this->attributes.end() )
         throw AttributeNotPresentException();
 
-    return this->attributes["type"];
+    return it->second;
 }
-std::string             MPD::getDuration            () throw(AttributeNotPresentException)
+const std::string&             MPD::getDuration            () const throw(AttributeNotPresentException)
 {
-    if(this->attributes.find("mediaPresentationDuration") == this->attributes.end())
+    AttributesMap::const_iterator     it = this->attributes.find("mediaPresentationDuration");
+
+    if( it == this->attributes.end())
         throw AttributeNotPresentException();
 
-    return this->attributes["mediaPresentationDuration"];
+    return it->second;
 }
 ProgramInformation*     MPD::getProgramInformation  () throw(ElementNotPresentException)
 {