[vlc-commits] Dash: static-ify isDash

Jean-Baptiste Kempf git at videolan.org
Thu Nov 17 17:04:53 CET 2011


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Nov 17 16:11:00 2011 +0100| [858cbefa36274fec93637f53dc33ba025abbd25b] | committer: Jean-Baptiste Kempf

Dash: static-ify isDash

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

 modules/stream_filter/dash/dash.cpp          |   15 ++++++++-------
 modules/stream_filter/dash/xml/DOMParser.cpp |    4 ++--
 modules/stream_filter/dash/xml/DOMParser.h   |    2 +-
 3 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/modules/stream_filter/dash/dash.cpp b/modules/stream_filter/dash/dash.cpp
index 04ebb3b..6699f4d 100644
--- a/modules/stream_filter/dash/dash.cpp
+++ b/modules/stream_filter/dash/dash.cpp
@@ -75,13 +75,14 @@ static int  Control         (stream_t *p_stream, int i_query, va_list args);
 /*****************************************************************************
  * Open:
  *****************************************************************************/
-static int Open(vlc_object_t *p_this)
+static int Open(vlc_object_t *p_obj)
 {
-    stream_t *p_stream = (stream_t*) p_this;
+    stream_t *p_stream = (stream_t*) p_obj;
 
-    dash::xml::DOMParser parser(p_stream->p_source);
-    if(!parser.isDash())
+    if(!dash::xml::DOMParser::isDash(p_stream->p_source))
         return VLC_EGENERIC;
+
+    dash::xml::DOMParser parser(p_stream->p_source);
     if(!parser.parse())
     {
         msg_Dbg(p_stream, "could not parse file");
@@ -111,16 +112,16 @@ static int Open(vlc_object_t *p_this)
     p_stream->pf_peek       = Peek;
     p_stream->pf_control    = Control;
 
-    msg_Dbg(p_this,"DASH filter: open (%s)", p_stream->psz_path);
+    msg_Dbg(p_obj,"DASH filter: open (%s)", p_stream->psz_path);
 
     return VLC_SUCCESS;
 }
 /*****************************************************************************
  * Close:
  *****************************************************************************/
-static void Close(vlc_object_t *p_this)
+static void Close(vlc_object_t *p_obj)
 {
-    stream_t                            *p_stream       = (stream_t*) p_this;
+    stream_t                            *p_stream       = (stream_t*) p_obj;
     stream_sys_t                        *p_sys          = (stream_sys_t *) p_stream->p_sys;
     dash::DASHManager                   *p_dashManager  = p_sys->p_dashManager;
     dash::http::HTTPConnectionManager   *p_conManager   = p_sys->p_conManager;
diff --git a/modules/stream_filter/dash/xml/DOMParser.cpp b/modules/stream_filter/dash/xml/DOMParser.cpp
index 9ed486d..aa18f91 100644
--- a/modules/stream_filter/dash/xml/DOMParser.cpp
+++ b/modules/stream_filter/dash/xml/DOMParser.cpp
@@ -139,11 +139,11 @@ Profile DOMParser::getProfile               (dash::xml::Node *node)
 
     return dash::mpd::NotValid;
 }
-bool    DOMParser::isDash                   ()
+bool    DOMParser::isDash                   (stream_t *stream)
 {
     const uint8_t *peek, *peek_end;
 
-    int64_t i_size = stream_Peek(this->stream, &peek, 2048);
+    int64_t i_size = stream_Peek(stream, &peek, 2048);
     if(i_size < 1)
         return false;
 
diff --git a/modules/stream_filter/dash/xml/DOMParser.h b/modules/stream_filter/dash/xml/DOMParser.h
index 5d47412..2042a5f 100644
--- a/modules/stream_filter/dash/xml/DOMParser.h
+++ b/modules/stream_filter/dash/xml/DOMParser.h
@@ -55,7 +55,7 @@ namespace dash
                 Node*               getRootNode ();
                 void                print       ();
                 dash::mpd::Profile  getProfile  (dash::xml::Node *node);
-                bool                isDash      ();
+                static bool         isDash      (stream_t *stream);
 
             private:
                 Node                *root;



More information about the vlc-commits mailing list