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