[vlc-commits] Dash: C++ sanitization

Jean-Baptiste Kempf git at videolan.org
Thu Nov 17 18:05:09 CET 2011


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Nov 17 18:04:16 2011 +0100| [476935e1d438241a86555f19ef970802f948c0b4] | committer: Jean-Baptiste Kempf

Dash: C++ sanitization

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=476935e1d438241a86555f19ef970802f948c0b4
---

 .../dash/adaptationlogic/IDownloadRateObserver.h   |    1 +
 modules/stream_filter/dash/http/Chunk.cpp          |    5 +++--
 modules/stream_filter/dash/http/IHTTPConnection.h  |    1 +
 modules/stream_filter/dash/mpd/BaseUrl.h           |    4 ++--
 modules/stream_filter/dash/mpd/BasicCMParser.cpp   |    3 +--
 modules/stream_filter/dash/mpd/IMPDManager.h       |    1 +
 modules/stream_filter/dash/mpd/IMPDParser.h        |    1 +
 modules/stream_filter/dash/mpd/ISegment.h          |    1 +
 8 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/modules/stream_filter/dash/adaptationlogic/IDownloadRateObserver.h b/modules/stream_filter/dash/adaptationlogic/IDownloadRateObserver.h
index cc4759c..e4d6d41 100644
--- a/modules/stream_filter/dash/adaptationlogic/IDownloadRateObserver.h
+++ b/modules/stream_filter/dash/adaptationlogic/IDownloadRateObserver.h
@@ -33,6 +33,7 @@ namespace dash
         {
             public:
                 virtual void downloadRateChanged(long bpsAvg, long bpsLastChunk) = 0;
+                virtual ~IDownloadRateObserver(){}
         };
     }
 }
diff --git a/modules/stream_filter/dash/http/Chunk.cpp b/modules/stream_filter/dash/http/Chunk.cpp
index 023c7e6..79eb74c 100644
--- a/modules/stream_filter/dash/http/Chunk.cpp
+++ b/modules/stream_filter/dash/http/Chunk.cpp
@@ -29,9 +29,10 @@
 
 using namespace dash::http;
 
-Chunk::Chunk()
-{
+Chunk::Chunk() : url()
 
+{
+    startByte = endByte = 0;
 }
 Chunk::~Chunk()
 {
diff --git a/modules/stream_filter/dash/http/IHTTPConnection.h b/modules/stream_filter/dash/http/IHTTPConnection.h
index 54e30c0..262ea5b 100644
--- a/modules/stream_filter/dash/http/IHTTPConnection.h
+++ b/modules/stream_filter/dash/http/IHTTPConnection.h
@@ -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() {}
         };
     }
 }
diff --git a/modules/stream_filter/dash/mpd/BaseUrl.h b/modules/stream_filter/dash/mpd/BaseUrl.h
index 02088e3..f7b5548 100644
--- a/modules/stream_filter/dash/mpd/BaseUrl.h
+++ b/modules/stream_filter/dash/mpd/BaseUrl.h
@@ -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;
diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.cpp b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
index ab58f56..256f1b7 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
@@ -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   ()
 {
diff --git a/modules/stream_filter/dash/mpd/IMPDManager.h b/modules/stream_filter/dash/mpd/IMPDManager.h
index 7b6491d..1c2b5c7 100644
--- a/modules/stream_filter/dash/mpd/IMPDManager.h
+++ b/modules/stream_filter/dash/mpd/IMPDManager.h
@@ -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(){}
         };
     }
 }
diff --git a/modules/stream_filter/dash/mpd/IMPDParser.h b/modules/stream_filter/dash/mpd/IMPDParser.h
index cea7b38..b6772b3 100644
--- a/modules/stream_filter/dash/mpd/IMPDParser.h
+++ b/modules/stream_filter/dash/mpd/IMPDParser.h
@@ -36,6 +36,7 @@ namespace dash
             public:
                 virtual bool    parse  () = 0;
                 virtual MPD*    getMPD () = 0;
+                virtual ~IMPDParser(){}
         };
     }
 }
diff --git a/modules/stream_filter/dash/mpd/ISegment.h b/modules/stream_filter/dash/mpd/ISegment.h
index 7464021..d8ac759 100644
--- a/modules/stream_filter/dash/mpd/ISegment.h
+++ b/modules/stream_filter/dash/mpd/ISegment.h
@@ -37,6 +37,7 @@ namespace dash
         {
             public:
                 virtual std::string getSourceUrl() throw(dash::exception::AttributeNotPresentException) = 0;
+                virtual ~ISegment(){}
         };
     }
 }



More information about the vlc-commits mailing list