[vlc-commits] core: move parsing options to the playlist category

Thomas Guillem git at videolan.org
Thu Sep 21 09:25:49 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Sep 21 09:18:29 2017 +0200| [63c67b8e6e789eac0fc614e4d2e2d92149442d3d] | committer: Thomas Guillem

core: move parsing options to the playlist category

These options don't belong to the demuxer anymore.

The "recursive" option is not used by the demux but by the input thread.
The other options can be used by any stream_t.

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

 modules/demux/directory.c | 34 ----------------------------------
 src/libvlc-module.c       | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+), 34 deletions(-)

diff --git a/modules/demux/directory.c b/modules/demux/directory.c
index 73f59f7665..07c4e0b4c8 100644
--- a/modules/demux/directory.c
+++ b/modules/demux/directory.c
@@ -85,46 +85,12 @@ static int Import_Dir( vlc_object_t *p_this )
     return VLC_SUCCESS;
 }
 
-static const char *const psz_recursive_list[] = {
-    "none", "collapse", "expand" };
-static const char *const psz_recursive_list_text[] = {
-    N_("None"), N_("Collapse"), N_("Expand") };
-
-#define RECURSIVE_TEXT N_("Subdirectory behavior")
-#define RECURSIVE_LONGTEXT N_( \
-        "Select whether subdirectories must be expanded.\n" \
-        "none: subdirectories do not appear in the playlist.\n" \
-        "collapse: subdirectories appear but are expanded on first play.\n" \
-        "expand: all subdirectories are expanded.\n" )
-
-#define IGNORE_TEXT N_("Ignored extensions")
-#define IGNORE_LONGTEXT N_( \
-        "Files with these extensions will not be added to playlist when " \
-        "opening a directory.\n" \
-        "This is useful if you add directories that contain playlist files " \
-        "for instance. Use a comma-separated list of extensions." )
-
-#define SHOW_HIDDENFILES_TEXT N_("Show hidden files")
-#define SHOW_HIDDENFILES_LONGTEXT N_( \
-        "Ignore files starting with '.'" )
-
 vlc_module_begin()
     set_category( CAT_INPUT )
     set_subcategory( SUBCAT_INPUT_DEMUX )
-
     set_shortname( N_("Directory") )
     set_description( N_("Directory import") )
     add_shortcut( "directory" )
     set_capability( "demux", 10 )
     set_callbacks( Import_Dir, NULL )
-
-    add_string( "recursive", "collapse" , RECURSIVE_TEXT,
-                RECURSIVE_LONGTEXT, false )
-        change_string_list( psz_recursive_list, psz_recursive_list_text )
-    add_string( "ignore-filetypes", "m3u,db,nfo,ini,jpg,jpeg,ljpg,gif,png,pgm,"
-                "pgmyuv,pbm,pam,tga,bmp,pnm,xpm,xcf,pcx,tif,tiff,lbm,sfv,txt,"
-                "sub,idx,srt,cue,ssa",
-                IGNORE_TEXT, IGNORE_LONGTEXT, false )
-    add_bool( "show-hiddenfiles", false,
-              SHOW_HIDDENFILES_TEXT, SHOW_HIDDENFILES_LONGTEXT, false )
 vlc_module_end()
diff --git a/src/libvlc-module.c b/src/libvlc-module.c
index d819e75672..ae6825fa12 100644
--- a/src/libvlc-module.c
+++ b/src/libvlc-module.c
@@ -1112,6 +1112,29 @@ static const char *const ppsz_prefres[] = {
 
 #define METADATA_NETWORK_TEXT N_( "Allow metadata network access" )
 
+static const char *const psz_recursive_list[] = {
+    "none", "collapse", "expand" };
+static const char *const psz_recursive_list_text[] = {
+    N_("None"), N_("Collapse"), N_("Expand") };
+
+#define RECURSIVE_TEXT N_("Subdirectory behavior")
+#define RECURSIVE_LONGTEXT N_( \
+        "Select whether subdirectories must be expanded.\n" \
+        "none: subdirectories do not appear in the playlist.\n" \
+        "collapse: subdirectories appear but are expanded on first play.\n" \
+        "expand: all subdirectories are expanded.\n" )
+
+#define IGNORE_TEXT N_("Ignored extensions")
+#define IGNORE_LONGTEXT N_( \
+        "Files with these extensions will not be added to playlist when " \
+        "opening a directory.\n" \
+        "This is useful if you add directories that contain playlist files " \
+        "for instance. Use a comma-separated list of extensions." )
+
+#define SHOW_HIDDENFILES_TEXT N_("Show hidden files")
+#define SHOW_HIDDENFILES_LONGTEXT N_( \
+        "Ignore files starting with '.'" )
+
 #define SD_TEXT N_( "Services discovery modules")
 #define SD_LONGTEXT N_( \
      "Specifies the services discovery modules to preload, separated by " \
@@ -2062,6 +2085,16 @@ vlc_module_begin ()
     add_bool( "metadata-network-access", false, METADATA_NETWORK_TEXT,
                  METADATA_NETWORK_TEXT, false )
 
+    add_string( "recursive", "collapse" , RECURSIVE_TEXT,
+                RECURSIVE_LONGTEXT, false )
+        change_string_list( psz_recursive_list, psz_recursive_list_text )
+    add_string( "ignore-filetypes", "m3u,db,nfo,ini,jpg,jpeg,ljpg,gif,png,pgm,"
+                "pgmyuv,pbm,pam,tga,bmp,pnm,xpm,xcf,pcx,tif,tiff,lbm,sfv,txt,"
+                "sub,idx,srt,cue,ssa",
+                IGNORE_TEXT, IGNORE_LONGTEXT, false )
+    add_bool( "show-hiddenfiles", false,
+              SHOW_HIDDENFILES_TEXT, SHOW_HIDDENFILES_LONGTEXT, false )
+
     set_subcategory( SUBCAT_PLAYLIST_SD )
     add_string( "services-discovery", "", SD_TEXT, SD_LONGTEXT, true )
         change_short('S')



More information about the vlc-commits mailing list