[vlc-devel] [PATCH 1/3] subtitle: move "sub-delay" option to libvlc

Thomas Guillem thomas at gllm.fr
Wed Oct 17 09:55:09 CEST 2018


Since this option is not handled (anymore?) by this module but by VLC core
(from input.c)
---
 modules/demux/subtitle.c | 5 -----
 src/libvlc-module.c      | 5 +++++
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/demux/subtitle.c b/modules/demux/subtitle.c
index 4b7eeefd59..2266c1446b 100644
--- a/modules/demux/subtitle.c
+++ b/modules/demux/subtitle.c
@@ -48,8 +48,6 @@
 static int  Open ( vlc_object_t *p_this );
 static void Close( vlc_object_t *p_this );
 
-#define SUB_DELAY_LONGTEXT \
-    N_("Apply a delay to all subtitles (in 1/10s, eg 100 means 10s).")
 #define SUB_FPS_LONGTEXT \
     N_("Override the normal frames per second settings. " \
     "This will only work with MicroDVD and SubRIP (SRT) subtitles.")
@@ -75,9 +73,6 @@ vlc_module_begin ()
     add_float( "sub-fps", 0.0,
                N_("Frames per Second"),
                SUB_FPS_LONGTEXT, true )
-    add_integer( "sub-delay", 0,
-               N_("Subtitle delay"),
-               SUB_DELAY_LONGTEXT, true )
     add_string( "sub-type", "auto", N_("Subtitle format"),
                 SUB_TYPE_LONGTEXT, true )
         change_string_list( ppsz_sub_type, ppsz_sub_type )
diff --git a/src/libvlc-module.c b/src/libvlc-module.c
index 64e76dd684..7747e286ce 100644
--- a/src/libvlc-module.c
+++ b/src/libvlc-module.c
@@ -764,6 +764,10 @@ static const char *const ppsz_prefres[] = {
     "Look for a subtitle file in those paths too, if your subtitle " \
     "file was not found in the current directory.")
 
+#define SUB_DELAY_TEXT N_("Subtitle delay")
+#define SUB_DELAY_LONGTEXT \
+    N_("Apply a delay to all subtitles (in 1/10s, eg 100 means 10s).")
+
 #define SUB_FILE_TEXT N_("Use subtitle file")
 #define SUB_FILE_LONGTEXT N_( \
     "Load this subtitle file. To be used when autodetect cannot detect " \
@@ -1702,6 +1706,7 @@ vlc_module_begin ()
                TEXTRENDERER_TEXT, TEXTRENDERER_LONGTEXT)
 
     set_section( N_("Subtitles") , NULL )
+    add_integer( "sub-delay", 0, SUB_DELAY_TEXT, SUB_DELAY_LONGTEXT, false )
     add_loadfile("sub-file", NULL, SUB_FILE_TEXT, SUB_FILE_LONGTEXT)
         change_safe()
     add_bool( "sub-autodetect-file", true,
-- 
2.19.1



More information about the vlc-devel mailing list