[vlc-devel] [PATCH 3/9] modules: playlist: Use a dedicated control function

Hugo Beauzée-Luyssen hugo at beauzee.fr
Thu Sep 17 11:28:59 CEST 2020


Which is just forwarding to the usual access_vaDirectoryControlHelper
for now
---
 modules/demux/playlist/asx.c      | 2 +-
 modules/demux/playlist/b4s.c      | 2 +-
 modules/demux/playlist/bdmv.c     | 2 +-
 modules/demux/playlist/dvb.c      | 2 +-
 modules/demux/playlist/ifo.c      | 2 +-
 modules/demux/playlist/itml.c     | 2 +-
 modules/demux/playlist/m3u.c      | 2 +-
 modules/demux/playlist/playlist.c | 6 ++++++
 modules/demux/playlist/playlist.h | 2 ++
 modules/demux/playlist/pls.c      | 2 +-
 modules/demux/playlist/podcast.c  | 2 +-
 modules/demux/playlist/qtl.c      | 2 +-
 modules/demux/playlist/ram.c      | 2 +-
 modules/demux/playlist/sgimb.c    | 2 +-
 modules/demux/playlist/wms.c      | 2 +-
 modules/demux/playlist/wpl.c      | 2 +-
 modules/demux/playlist/xspf.c     | 2 +-
 17 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/modules/demux/playlist/asx.c b/modules/demux/playlist/asx.c
index 3d0875bcac..e17be85e96 100644
--- a/modules/demux/playlist/asx.c
+++ b/modules/demux/playlist/asx.c
@@ -176,7 +176,7 @@ int Import_ASX( vlc_object_t *p_this )
         return VLC_EGENERIC;
     }
 
-    p_demux->pf_control = access_vaDirectoryControlHelper;
+    p_demux->pf_control = PlaylistControl;
     p_demux->pf_readdir = ReadDir;
     return VLC_SUCCESS;
 }
diff --git a/modules/demux/playlist/b4s.c b/modules/demux/playlist/b4s.c
index dabdac1aaf..cf6af71c3d 100644
--- a/modules/demux/playlist/b4s.c
+++ b/modules/demux/playlist/b4s.c
@@ -53,7 +53,7 @@ int Import_B4S( vlc_object_t *p_this )
         return VLC_EGENERIC;
 
     demux->pf_readdir = ReadDir;
-    demux->pf_control = access_vaDirectoryControlHelper;
+    demux->pf_control = PlaylistControl;
 
     return VLC_SUCCESS;
 }
diff --git a/modules/demux/playlist/bdmv.c b/modules/demux/playlist/bdmv.c
index d682c9275b..ab1f283838 100644
--- a/modules/demux/playlist/bdmv.c
+++ b/modules/demux/playlist/bdmv.c
@@ -82,7 +82,7 @@ int Import_BDMV( vlc_object_t *p_this )
     if( i_peek < 8 || memcmp( p_peek, psz_probe, 8 ) )
         return VLC_EGENERIC;
 
-    p_stream->pf_control = access_vaDirectoryControlHelper;
+    p_stream->pf_control = PlaylistControl;
 
     return VLC_SUCCESS;
 }
diff --git a/modules/demux/playlist/dvb.c b/modules/demux/playlist/dvb.c
index 76ae4b88da..5dc6220203 100644
--- a/modules/demux/playlist/dvb.c
+++ b/modules/demux/playlist/dvb.c
@@ -70,7 +70,7 @@ int Import_DVB(vlc_object_t *p_this)
     input_item_Release(item);
 
     msg_Dbg(demux, "found valid channels.conf file");
-    demux->pf_control = access_vaDirectoryControlHelper;
+    demux->pf_control = PlaylistControl;
     demux->pf_readdir = ReadDir;
 
     return VLC_SUCCESS;
diff --git a/modules/demux/playlist/ifo.c b/modules/demux/playlist/ifo.c
index 8009a8e51e..b62837f2fb 100644
--- a/modules/demux/playlist/ifo.c
+++ b/modules/demux/playlist/ifo.c
@@ -91,7 +91,7 @@ int Import_IFO( vlc_object_t *p_this )
     if( i_peek < 8 || memcmp( p_peek, psz_probe, 8 ) )
         return VLC_EGENERIC;
 
-    p_stream->pf_control = access_vaDirectoryControlHelper;
+    p_stream->pf_control = PlaylistControl;
 
     return VLC_SUCCESS;
 }
diff --git a/modules/demux/playlist/itml.c b/modules/demux/playlist/itml.c
index f00447803b..0e4daccce7 100644
--- a/modules/demux/playlist/itml.c
+++ b/modules/demux/playlist/itml.c
@@ -59,7 +59,7 @@ int Import_iTML( vlc_object_t *p_this )
     msg_Dbg( p_demux, "using iTunes Media Library reader" );
 
     p_demux->pf_readdir = ReadDir;
-    p_demux->pf_control = access_vaDirectoryControlHelper;
+    p_demux->pf_control = PlaylistControl;
 
     return VLC_SUCCESS;
 }
diff --git a/modules/demux/playlist/m3u.c b/modules/demux/playlist/m3u.c
index 854f885e22..af743b75da 100644
--- a/modules/demux/playlist/m3u.c
+++ b/modules/demux/playlist/m3u.c
@@ -142,7 +142,7 @@ int Import_M3U( vlc_object_t *p_this )
     msg_Dbg( p_stream, "found valid M3U playlist" );
     p_stream->p_sys = pf_dup;
     p_stream->pf_readdir = ReadDir;
-    p_stream->pf_control = access_vaDirectoryControlHelper;
+    p_stream->pf_control = PlaylistControl;
 
     return VLC_SUCCESS;
 }
diff --git a/modules/demux/playlist/playlist.c b/modules/demux/playlist/playlist.c
index d3cca7a502..1b3a345603 100644
--- a/modules/demux/playlist/playlist.c
+++ b/modules/demux/playlist/playlist.c
@@ -31,6 +31,7 @@
 #include <vlc_plugin.h>
 #include <vlc_demux.h>
 #include <vlc_url.h>
+#include <vlc_access.h>
 
 #if defined( _WIN32 ) || defined( __OS2__ )
 # include <ctype.h>                          /* isalpha */
@@ -200,3 +201,8 @@ char *ProcessMRL(const char *str, const char *base)
 
     return abs;
 }
+
+int PlaylistControl( stream_t *p_access, int i_query, va_list args )
+{
+    return access_vaDirectoryControlHelper( p_access, i_query, args );
+}
diff --git a/modules/demux/playlist/playlist.h b/modules/demux/playlist/playlist.h
index 10a9135bbf..da7fa2affc 100644
--- a/modules/demux/playlist/playlist.h
+++ b/modules/demux/playlist/playlist.h
@@ -24,6 +24,8 @@
 
 char *ProcessMRL( const char *, const char * );
 
+int PlaylistControl( stream_t *p_access, int i_query, va_list args );
+
 int Import_M3U ( vlc_object_t * );
 
 int Import_RAM ( vlc_object_t * );
diff --git a/modules/demux/playlist/pls.c b/modules/demux/playlist/pls.c
index 132be9b8a9..7ad7fad29a 100644
--- a/modules/demux/playlist/pls.c
+++ b/modules/demux/playlist/pls.c
@@ -60,7 +60,7 @@ int Import_PLS( vlc_object_t *p_this )
 
     msg_Dbg( p_demux, "found valid PLS playlist file");
     p_demux->pf_readdir = ReadDir;
-    p_demux->pf_control = access_vaDirectoryControlHelper;
+    p_demux->pf_control = PlaylistControl;
 
     return VLC_SUCCESS;
 }
diff --git a/modules/demux/playlist/podcast.c b/modules/demux/playlist/podcast.c
index 3251ad3ce4..9fb5181fb4 100644
--- a/modules/demux/playlist/podcast.c
+++ b/modules/demux/playlist/podcast.c
@@ -89,7 +89,7 @@ int Import_podcast( vlc_object_t *p_this )
         return VLC_EGENERIC;
 
     p_demux->pf_readdir = ReadDir;
-    p_demux->pf_control = access_vaDirectoryControlHelper;
+    p_demux->pf_control = PlaylistControl;
     msg_Dbg( p_demux, "using podcast reader" );
 
     return VLC_SUCCESS;
diff --git a/modules/demux/playlist/qtl.c b/modules/demux/playlist/qtl.c
index d020b9f837..9c8032787d 100644
--- a/modules/demux/playlist/qtl.c
+++ b/modules/demux/playlist/qtl.c
@@ -88,7 +88,7 @@ int Import_QTL( vlc_object_t *p_this )
         return VLC_EGENERIC;
 
     p_demux->pf_readdir = ReadDir;
-    p_demux->pf_control = access_vaDirectoryControlHelper;
+    p_demux->pf_control = PlaylistControl;
     msg_Dbg( p_demux, "using QuickTime Media Link reader" );
 
     return VLC_SUCCESS;
diff --git a/modules/demux/playlist/ram.c b/modules/demux/playlist/ram.c
index add5618690..5a37d4745c 100644
--- a/modules/demux/playlist/ram.c
+++ b/modules/demux/playlist/ram.c
@@ -88,7 +88,7 @@ int Import_RAM( vlc_object_t *p_this )
 
     msg_Dbg( p_demux, "found valid RAM playlist" );
     p_demux->pf_readdir = ReadDir;
-    p_demux->pf_control = access_vaDirectoryControlHelper;
+    p_demux->pf_control = PlaylistControl;
 
     return VLC_SUCCESS;
 }
diff --git a/modules/demux/playlist/sgimb.c b/modules/demux/playlist/sgimb.c
index dabed0c508..f5a9d6a36e 100644
--- a/modules/demux/playlist/sgimb.c
+++ b/modules/demux/playlist/sgimb.c
@@ -159,7 +159,7 @@ int Import_SGIMB( vlc_object_t * p_this )
 
             msg_Dbg( p_demux, "using SGIMB playlist reader" );
             p_demux->pf_readdir = ReadDir;
-            p_demux->pf_control = access_vaDirectoryControlHelper;
+            p_demux->pf_control = PlaylistControl;
             p_demux->p_sys = p_sys;
             p_sys->psz_uri = NULL;
             p_sys->psz_server = NULL;
diff --git a/modules/demux/playlist/wms.c b/modules/demux/playlist/wms.c
index 08768e33be..6f14fd09e0 100644
--- a/modules/demux/playlist/wms.c
+++ b/modules/demux/playlist/wms.c
@@ -81,6 +81,6 @@ int Import_WMS(vlc_object_t *obj)
 
     msg_Dbg(demux, "found WMS metafile");
     demux->pf_readdir = ReadDir;
-    demux->pf_control = access_vaDirectoryControlHelper;
+    demux->pf_control = PlaylistControl;
     return VLC_SUCCESS;
 }
diff --git a/modules/demux/playlist/wpl.c b/modules/demux/playlist/wpl.c
index e9496fd140..f8d8b7a004 100644
--- a/modules/demux/playlist/wpl.c
+++ b/modules/demux/playlist/wpl.c
@@ -324,7 +324,7 @@ int Import_WPL( vlc_object_t* p_this )
 
     msg_Dbg( p_demux, "Found valid WPL playlist" );
     p_demux->pf_readdir = Demux;
-    p_demux->pf_control = access_vaDirectoryControlHelper;
+    p_demux->pf_control = PlaylistControl;
 
     return VLC_SUCCESS;
 }
diff --git a/modules/demux/playlist/xspf.c b/modules/demux/playlist/xspf.c
index 1f11eaba5e..5c054f89eb 100644
--- a/modules/demux/playlist/xspf.c
+++ b/modules/demux/playlist/xspf.c
@@ -102,7 +102,7 @@ int Import_xspf(vlc_object_t *p_this)
     msg_Dbg(p_stream, "using XSPF playlist reader");
     p_stream->p_sys = sys;
     p_stream->pf_readdir = ReadDir;
-    p_stream->pf_control = access_vaDirectoryControlHelper;
+    p_stream->pf_control = PlaylistControl;
 
     return VLC_SUCCESS;
 }
-- 
2.20.1



More information about the vlc-devel mailing list