[vlc-devel] [PATCH 3/9] dash: fixed warnings in basiccm and isoffmainmanager

Christopher at mailsrv.uni-klu.ac.at Christopher at mailsrv.uni-klu.ac.at
Fri Mar 9 19:05:21 CET 2012


From: Christopher Mueller <christopher.mueller at itec.aau.at>

---
 modules/stream_filter/dash/mpd/BasicCMManager.cpp  |    2 +-
 modules/stream_filter/dash/mpd/BasicCMParser.cpp   |    6 ------
 .../stream_filter/dash/mpd/IsoffMainManager.cpp    |    4 ++--
 modules/stream_filter/dash/mpd/Representation.cpp  |    8 ++++----
 modules/stream_filter/dash/mpd/Representation.h    |    6 +++---
 5 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/BasicCMManager.cpp b/modules/stream_filter/dash/mpd/BasicCMManager.cpp
index b96d2fd..a42da61 100644
--- a/modules/stream_filter/dash/mpd/BasicCMManager.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMManager.cpp
@@ -103,7 +103,7 @@ Representation*         BasicCMManager::getRepresentation(Period *period, uint64
         std::vector<Representation *> reps = groups.at(i)->getRepresentations();
         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 );
 
             if ( best == NULL ||
diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.cpp b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
index fc0b0ea..86c2fd1 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
@@ -501,12 +501,6 @@ bool    BasicCMParser::resolveUrlTemplates( std::string &url, bool &containRunti
         }
         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;
             oss << this->currentRepresentation->getBandwidth();
             url.replace( it, token.length(), oss.str() );
diff --git a/modules/stream_filter/dash/mpd/IsoffMainManager.cpp b/modules/stream_filter/dash/mpd/IsoffMainManager.cpp
index 0494ea7..2ad4185 100644
--- a/modules/stream_filter/dash/mpd/IsoffMainManager.cpp
+++ b/modules/stream_filter/dash/mpd/IsoffMainManager.cpp
@@ -102,7 +102,7 @@ Representation*             IsoffMainManager::getRepresentation     (Period *per
         std::vector<Representation *> reps = adaptationSets.at(i)->getRepresentations();
         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))
             {
@@ -165,7 +165,7 @@ Representation*             IsoffMainManager::getRepresentation     (Period *per
     Representation  *best = NULL;
     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))
         {
diff --git a/modules/stream_filter/dash/mpd/Representation.cpp b/modules/stream_filter/dash/mpd/Representation.cpp
index 9f31f5c..e561cc2 100644
--- a/modules/stream_filter/dash/mpd/Representation.cpp
+++ b/modules/stream_filter/dash/mpd/Representation.cpp
@@ -32,6 +32,7 @@
 using namespace dash::mpd;
 
 Representation::Representation  () :
+                bandwidth       (0),
                 qualityRanking  ( -1 ),
                 segmentInfo     ( NULL ),
                 trickModeType   ( NULL ),
@@ -61,15 +62,14 @@ void    Representation::setId(const std::string &id)
         this->id = id;
 }
 
-int     Representation::getBandwidth            () const
+uint64_t     Representation::getBandwidth            () const
 {
     return this->bandwidth;
 }
 
-void    Representation::setBandwidth( int bandwidth )
+void    Representation::setBandwidth( uint64_t bandwidth )
 {
-    if ( bandwidth >= 0 )
-        this->bandwidth = bandwidth;
+    this->bandwidth = bandwidth;
 }
 
 SegmentInfo*        Representation::getSegmentInfo() const
diff --git a/modules/stream_filter/dash/mpd/Representation.h b/modules/stream_filter/dash/mpd/Representation.h
index 710e2f4..0fef462 100644
--- a/modules/stream_filter/dash/mpd/Representation.h
+++ b/modules/stream_filter/dash/mpd/Representation.h
@@ -53,8 +53,8 @@ namespace dash
                  *          Will be a valid value, as the parser refuses Representation
                  *          without bandwidth.
                  */
-                int                 getBandwidth            () const;
-                void                setBandwidth            ( int bandwidth );
+                uint64_t            getBandwidth            () const;
+                void                setBandwidth            ( uint64_t bandwidth );
                 int                 getQualityRanking       () const;
                 void                setQualityRanking       ( int qualityRanking );
                 const std::list<const Representation*>&     getDependencies() const;
@@ -82,7 +82,7 @@ namespace dash
                 int                 getHeight               () const;
 
             private:
-                int                                 bandwidth;
+                uint64_t                            bandwidth;
                 std::string                         id;
                 int                                 qualityRanking;
                 std::list<const Representation*>    dependencies;
-- 
1.7.0.4




More information about the vlc-devel mailing list