[vlc-commits] qtl: convert to stream filter

Rémi Denis-Courmont git at videolan.org
Sat Jun 3 22:02:28 CEST 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon May 22 20:42:37 2017 +0300| [b2d66b5c38d1bc843df99e18e55c5709ff4f092f] | committer: Rémi Denis-Courmont

qtl: convert to stream filter

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

 modules/demux/playlist/playlist.c |  4 ++--
 modules/demux/playlist/qtl.c      | 20 ++++++++------------
 2 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/modules/demux/playlist/playlist.c b/modules/demux/playlist/playlist.c
index 88342166ac..51fc0deed4 100644
--- a/modules/demux/playlist/playlist.c
+++ b/modules/demux/playlist/playlist.c
@@ -114,8 +114,8 @@ vlc_module_begin ()
         set_callbacks( Import_SGIMB, Close_SGIMB )
     add_submodule ()
         set_description( N_("QuickTime Media Link importer") )
-        add_shortcut( "playlist", "qtl" )
-        set_capability( "demux", 10 )
+        add_shortcut( "qtl" )
+        set_capability( "stream_filter", 10 )
         set_callbacks( Import_QTL, NULL )
     add_submodule ()
         set_description( N_("Dummy IFO demux") )
diff --git a/modules/demux/playlist/qtl.c b/modules/demux/playlist/qtl.c
index 727b6dedcb..1c5004f43b 100644
--- a/modules/demux/playlist/qtl.c
+++ b/modules/demux/playlist/qtl.c
@@ -53,7 +53,7 @@ volume - 0 (mute) - 100 (max)
 #endif
 
 #include <vlc_common.h>
-#include <vlc_demux.h>
+#include <vlc_access.h>
 
 #include "playlist.h"
 #include <vlc_xml.h>
@@ -75,27 +75,27 @@ const char* ppsz_loop[] = { "true", "false", "palindrome" };
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-static int Demux( demux_t *p_demux);
+static int ReadDir( stream_t *, input_item_node_t * );
 
 /*****************************************************************************
  * Import_QTL: main import function
  *****************************************************************************/
 int Import_QTL( vlc_object_t *p_this )
 {
-    demux_t *p_demux = (demux_t *)p_this;
+    stream_t *p_demux = (stream_t *)p_this;
 
     CHECK_FILE(p_demux);
-    if( !demux_IsPathExtension( p_demux, ".qtl" ) )
+    if( !stream_HasExtension( p_demux, ".qtl" ) )
         return VLC_EGENERIC;
 
-    p_demux->pf_demux = Demux;
-    p_demux->pf_control = Control;
+    p_demux->pf_readdir = ReadDir;
+    p_demux->pf_control = access_vaDirectoryControlHelper;
     msg_Dbg( p_demux, "using QuickTime Media Link reader" );
 
     return VLC_SUCCESS;
 }
 
-static int Demux( demux_t *p_demux )
+static int ReadDir( stream_t *p_demux, input_item_node_t *p_subitems )
 {
     xml_reader_t *p_xml_reader;
     input_item_t *p_input;
@@ -117,9 +117,7 @@ static int Demux( demux_t *p_demux )
     char *psz_mimetype = NULL;
     int i_volume = 100;
 
-    input_item_t *p_current_input = GetCurrentItem(p_demux);
-
-    p_xml_reader = xml_ReaderCreate( p_demux, p_demux->s );
+    p_xml_reader = xml_ReaderCreate( p_demux, p_demux->p_source );
     if( !p_xml_reader )
         goto error;
 
@@ -237,7 +235,6 @@ static int Demux( demux_t *p_demux )
     }
     else
     {
-        input_item_node_t *p_subitems = input_item_node_Create( p_current_input );
         p_input = input_item_New( psz_src, psz_moviename );
 #define SADD_INFO( type, field ) if( field ) { input_item_AddInfo( \
                     p_input, "QuickTime Media Link", type, "%s", field ) ; }
@@ -252,7 +249,6 @@ static int Demux( demux_t *p_demux )
             input_item_node_AppendItem( p_subitems, p_input );
             input_item_Release( p_input );
         }
-        input_item_node_PostAndDelete( p_subitems );
     }
 
     i_ret = 0; /* Needed for correct operation of go back */



More information about the vlc-commits mailing list