]> git.sesse.net Git - vlc/commitdiff
Dash: static-ify isDash
authorJean-Baptiste Kempf <jb@videolan.org>
Thu, 17 Nov 2011 15:11:00 +0000 (16:11 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 17 Nov 2011 15:11:00 +0000 (16:11 +0100)
modules/stream_filter/dash/dash.cpp
modules/stream_filter/dash/xml/DOMParser.cpp
modules/stream_filter/dash/xml/DOMParser.h

index 04ebb3b541914d94a1e7f5b4a254bbdde810f12d..6699f4d908c7f2e02fb19bf9a7672bb98105adf5 100644 (file)
@@ -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;
index 9ed486d41355c8c054f1222e44d2adcf13c81ed9..aa18f91628e6b8272ee08e80ba5b1c7b50371955 100644 (file)
@@ -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;
 
index 5d474127791721c20ed2adb5c2acd896d3c146b4..2042a5fe1561b910f5583b8129d60976f6b9967b 100644 (file)
@@ -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;