]> git.sesse.net Git - vlc/commitdiff
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 cc4759cbd1d1595e4e37c49095d020e32dbe7790..e4d6d41842c4926210906f9c9284494daf82f7f4 100644 (file)
@@ -33,6 +33,7 @@ namespace dash
         {
             public:
                 virtual void downloadRateChanged(long bpsAvg, long bpsLastChunk) = 0;
+                virtual ~IDownloadRateObserver(){}
         };
     }
 }
index 023c7e60fb1da71c859fd3d663beee95c79001c4..79eb74c90b3bf11e37aa0149bdd54c29cc1cae53 100644 (file)
 
 using namespace dash::http;
 
-Chunk::Chunk()
-{
+Chunk::Chunk() : url()
 
+{
+    startByte = endByte = 0;
 }
 Chunk::~Chunk()
 {
index 54e30c06889ba3885e08b4ddc44b7f76e4326205..262ea5bc42e62428cdfd6471adfc16cb04212a34 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 02088e3bdb50db1eec8dcea3f6d51526ef993afa..f7b554853e7cb4a4163df34bbb483705540c6d64 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 ab58f56062c0691e82393ac801a849b0a3d7480a..256f1b74e2deb949a8bc9072e5b7fd4f9651c057 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 7b6491d85dc999483ea3d240c3d5aaecf9cc5877..1c2b5c75bcbc20b6ab35f1545b5e85a5dfd00962 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 cea7b388dab442e5dcbe3a45257639fbe4c72878..b6772b3f22367d975b399059647b400ea84f96b5 100644 (file)
@@ -36,6 +36,7 @@ namespace dash
             public:
                 virtual bool    parse  () = 0;
                 virtual MPD*    getMPD () = 0;
+                virtual ~IMPDParser(){}
         };
     }
 }
index 74640212546d3d0f14bdb31d3593844037a418f3..d8ac7599e3f0b7244898a2fa0f6f0afd1cf6b922 100644 (file)
@@ -37,6 +37,7 @@ namespace dash
         {
             public:
                 virtual std::string getSourceUrl() throw(dash::exception::AttributeNotPresentException) = 0;
+                virtual ~ISegment(){}
         };
     }
 }