Commit 121f1710 authored by Christopher Mueller's avatar Christopher Mueller Committed by Hugo Beauzée-Luyssen

dash: fixed warnings in basiccm and isoffmainmanager

Signed-off-by: default avatarHugo Beauzée-Luyssen <beauze.h@gmail.com>
parent 60ceaa11
...@@ -103,7 +103,7 @@ Representation* BasicCMManager::getRepresentation(Period *period, uint64 ...@@ -103,7 +103,7 @@ Representation* BasicCMManager::getRepresentation(Period *period, uint64
std::vector<Representation *> reps = groups.at(i)->getRepresentations(); std::vector<Representation *> reps = groups.at(i)->getRepresentations();
for( size_t j = 0; j < reps.size(); j++ ) for( size_t j = 0; j < reps.size(); j++ )
{ {
int currentBitrate = reps.at(j)->getBandwidth(); uint64_t currentBitrate = reps.at(j)->getBandwidth();
assert( currentBitrate != -1 ); assert( currentBitrate != -1 );
if ( best == NULL || if ( best == NULL ||
......
...@@ -501,12 +501,6 @@ bool BasicCMParser::resolveUrlTemplates( std::string &url, bool &containRunti ...@@ -501,12 +501,6 @@ bool BasicCMParser::resolveUrlTemplates( std::string &url, bool &containRunti
} }
else if ( token == "$Bandwidth$" ) else if ( token == "$Bandwidth$" )
{ {
if ( this->currentRepresentation->getBandwidth() < 0 )
{
std::cerr << "Representation doesn't have a valid bandwidth. "
"Can't substitute tag $Bandwidth$" << std::endl;
return false;
}
std::ostringstream oss; std::ostringstream oss;
oss << this->currentRepresentation->getBandwidth(); oss << this->currentRepresentation->getBandwidth();
url.replace( it, token.length(), oss.str() ); url.replace( it, token.length(), oss.str() );
......
...@@ -102,7 +102,7 @@ Representation* IsoffMainManager::getRepresentation (Period *per ...@@ -102,7 +102,7 @@ Representation* IsoffMainManager::getRepresentation (Period *per
std::vector<Representation *> reps = adaptationSets.at(i)->getRepresentations(); std::vector<Representation *> reps = adaptationSets.at(i)->getRepresentations();
for( size_t j = 0; j < reps.size(); j++ ) for( size_t j = 0; j < reps.size(); j++ )
{ {
int currentBitrate = reps.at(j)->getBandwidth(); uint64_t currentBitrate = reps.at(j)->getBandwidth();
if(best == NULL || (currentBitrate > best->getBandwidth() && currentBitrate < bitrate)) if(best == NULL || (currentBitrate > best->getBandwidth() && currentBitrate < bitrate))
{ {
...@@ -165,7 +165,7 @@ Representation* IsoffMainManager::getRepresentation (Period *per ...@@ -165,7 +165,7 @@ Representation* IsoffMainManager::getRepresentation (Period *per
Representation *best = NULL; Representation *best = NULL;
for( size_t j = 0; j < resMatchReps.size(); j++ ) for( size_t j = 0; j < resMatchReps.size(); j++ )
{ {
int currentBitrate = resMatchReps.at(j)->getBandwidth(); uint64_t currentBitrate = resMatchReps.at(j)->getBandwidth();
if(best == NULL || (currentBitrate > best->getBandwidth() && currentBitrate < bitrate)) if(best == NULL || (currentBitrate > best->getBandwidth() && currentBitrate < bitrate))
{ {
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
using namespace dash::mpd; using namespace dash::mpd;
Representation::Representation () : Representation::Representation () :
bandwidth (0),
qualityRanking ( -1 ), qualityRanking ( -1 ),
segmentInfo ( NULL ), segmentInfo ( NULL ),
trickModeType ( NULL ), trickModeType ( NULL ),
...@@ -61,14 +62,13 @@ void Representation::setId(const std::string &id) ...@@ -61,14 +62,13 @@ void Representation::setId(const std::string &id)
this->id = id; this->id = id;
} }
int Representation::getBandwidth () const uint64_t Representation::getBandwidth () const
{ {
return this->bandwidth; return this->bandwidth;
} }
void Representation::setBandwidth( int bandwidth ) void Representation::setBandwidth( uint64_t bandwidth )
{ {
if ( bandwidth >= 0 )
this->bandwidth = bandwidth; this->bandwidth = bandwidth;
} }
......
...@@ -53,8 +53,8 @@ namespace dash ...@@ -53,8 +53,8 @@ namespace dash
* Will be a valid value, as the parser refuses Representation * Will be a valid value, as the parser refuses Representation
* without bandwidth. * without bandwidth.
*/ */
int getBandwidth () const; uint64_t getBandwidth () const;
void setBandwidth ( int bandwidth ); void setBandwidth ( uint64_t bandwidth );
int getQualityRanking () const; int getQualityRanking () const;
void setQualityRanking ( int qualityRanking ); void setQualityRanking ( int qualityRanking );
const std::list<const Representation*>& getDependencies() const; const std::list<const Representation*>& getDependencies() const;
...@@ -82,7 +82,7 @@ namespace dash ...@@ -82,7 +82,7 @@ namespace dash
int getHeight () const; int getHeight () const;
private: private:
int bandwidth; uint64_t bandwidth;
std::string id; std::string id;
int qualityRanking; int qualityRanking;
std::list<const Representation*> dependencies; std::list<const Representation*> dependencies;
......
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