Dash: C++ sanitization
authorJean-Baptiste Kempf <jb@videolan.org>
Thu, 17 Nov 2011 17:04:16 +0000 (18:04 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 17 Nov 2011 17:04:16 +0000 (18:04 +0100)
modules/stream_filter/dash/adaptationlogic/IDownloadRateObserver.h
modules/stream_filter/dash/http/Chunk.cpp
modules/stream_filter/dash/http/IHTTPConnection.h
modules/stream_filter/dash/mpd/BaseUrl.h
modules/stream_filter/dash/mpd/BasicCMParser.cpp
modules/stream_filter/dash/mpd/IMPDManager.h
modules/stream_filter/dash/mpd/IMPDParser.h
modules/stream_filter/dash/mpd/ISegment.h

index cc4759c..e4d6d41 100644 (file)
@@ -33,6 +33,7 @@ namespace dash
         {
             public:
                 virtual void downloadRateChanged(long bpsAvg, long bpsLastChunk) = 0;
+                virtual ~IDownloadRateObserver(){}
         };
     }
 }
index 023c7e6..79eb74c 100644 (file)
 
 using namespace dash::http;
 
-Chunk::Chunk()
-{
+Chunk::Chunk() : url()
 
+{
+    startByte = endByte = 0;
 }
 Chunk::~Chunk()
 {
index 54e30c0..262ea5b 100644 (file)
@@ -37,6 +37,7 @@ namespace dash
             public:
                 virtual int     read        (void *p_buffer, size_t len)              = 0;
                 virtual int     peek        (const uint8_t **pp_peek, size_t i_peek)  = 0;
+                virtual ~IHTTPConnection() {}
         };
     }
 }
index 02088e3..f7b5548 100644 (file)
@@ -34,10 +34,10 @@ namespace dash
         class BaseUrl
         {
             public:
-                BaseUrl         (std::string url)   { this->url = url; }
+            BaseUrl         (const std::string& url) : url(url) {}
                 virtual ~BaseUrl()                  {}
 
-                std::string getUrl() { return this->url; }
+                const std::string& getUrl() const { return this->url; }
 
             private:
                 std::string url;
index ab58f56..256f1b7 100644 (file)
@@ -30,9 +30,8 @@
 using namespace dash::mpd;
 using namespace dash::xml;
 
-BasicCMParser::BasicCMParser    (Node *root)
+BasicCMParser::BasicCMParser    (Node *root) : root(root), mpd(NULL)
 {
-    this->root = root;
 }
 BasicCMParser::~BasicCMParser   ()
 {
index 7b6491d..1c2b5c7 100644 (file)
@@ -32,6 +32,7 @@ namespace dash
                 virtual Representation*         getBestRepresentation   (Period *period)                = 0;
                 virtual std::vector<ISegment *> getSegments             (Representation *rep)           = 0;
                 virtual Representation*         getRepresentation       (Period *period, long bitrate)  = 0;
+                virtual ~IMPDManager(){}
         };
     }
 }
index cea7b38..b6772b3 100644 (file)
@@ -36,6 +36,7 @@ namespace dash
             public:
                 virtual bool    parse  () = 0;
                 virtual MPD*    getMPD () = 0;
+                virtual ~IMPDParser(){}
         };
     }
 }
index 7464021..d8ac759 100644 (file)
@@ -37,6 +37,7 @@ namespace dash
         {
             public:
                 virtual std::string getSourceUrl() throw(dash::exception::AttributeNotPresentException) = 0;
+                virtual ~ISegment(){}
         };
     }
 }