Commit 694ae8e7 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen Committed by Jean-Baptiste Kempf

dash: Cleaning Period class.

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit 98a01d40722a080842a7e85b2a657bd946a7ea14)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent de45860f
...@@ -157,7 +157,7 @@ void BasicCMParser::setPeriods (Node *root) ...@@ -157,7 +157,7 @@ void BasicCMParser::setPeriods (Node *root)
for(size_t i = 0; i < periods.size(); i++) for(size_t i = 0; i < periods.size(); i++)
{ {
Period *period = new Period(periods.at(i)->getAttributes()); Period *period = new Period();
this->setGroups(periods.at(i), period); this->setGroups(periods.at(i), period);
this->mpd->addPeriod(period); this->mpd->addPeriod(period);
} }
......
...@@ -21,29 +21,34 @@ ...@@ -21,29 +21,34 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include "config.h" # include "config.h"
#endif #endif
#include "Period.h" #include "Period.h"
#include <vlc_common.h>
#include <vlc_arrays.h>
using namespace dash::mpd; using namespace dash::mpd;
Period::Period (std::map<std::string, std::string> attributes) Period::Period()
{ {
this->attributes = attributes;
} }
Period::~Period () Period::~Period ()
{ {
for(size_t i = 0; i < this->groups.size(); i++) vlc_delete_all( this->groups );
delete(this->groups.at(i));
} }
std::vector<Group*> Period::getGroups () const std::vector<Group*>& Period::getGroups() const
{ {
return this->groups; return this->groups;
} }
void Period::addGroup (Group *group)
void Period::addGroup(Group *group)
{ {
if ( group != NULL )
this->groups.push_back(group); this->groups.push_back(group);
} }
...@@ -26,10 +26,8 @@ ...@@ -26,10 +26,8 @@
#include <vector> #include <vector>
#include <string> #include <string>
#include <map>
#include "mpd/Group.h" #include "mpd/Group.h"
#include "mpd/Representation.h"
namespace dash namespace dash
{ {
...@@ -38,17 +36,14 @@ namespace dash ...@@ -38,17 +36,14 @@ namespace dash
class Period class Period
{ {
public: public:
Period (std::map<std::string, std::string> attributes); Period();
virtual ~Period (); virtual ~Period ();
std::vector<Group *> getGroups (); const std::vector<Group *>& getGroups() const;
void addGroup (Group *group); void addGroup( Group *group );
private: private:
std::map<std::string, std::string> attributes;
std::vector<Group *> groups; std::vector<Group *> groups;
}; };
} }
} }
......
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