[vlc-commits] [Git][videolan/vlc][master] 14 commits: cdda+vcd: fix confusing help text output

Jean-Baptiste Kempf gitlab at videolan.org
Sat May 29 20:16:05 UTC 2021



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
530f7860 by Lyndon Brown at 2021-05-29T19:18:06+01:00
cdda+vcd: fix confusing help text output

usage hint is the wrong thing to use, help text is the right thing;
this mistake is the cause of confusing help output due to the fact that
usage hints are printed exactly the same as a plugin/module heading.

- - - - -
c5f04152 by Lyndon Brown at 2021-05-29T19:18:06+01:00
plugins: purge now unused `add_usage_hint()`

cdda and vcd were the only users, both have now been switched to use
`set_help()`.

- - - - -
566a7317 by Lyndon Brown at 2021-05-29T19:18:06+01:00
mp4: fix help output bug

'cat hints' should only be used by the core (to define a set of
headings to break its large set of options up with, instead of the
option tree items).

incorrectly using a cat hint here instead of a section means that this
"hacks" sub-heading gets printed like a module heading, which is both
imperfect from a neatness point of view, but also and more importantly
potentially confusing.

- - - - -
3a82d263 by Lyndon Brown at 2021-05-29T19:18:06+01:00
plugins: privatise `add_category_hint()`

this is to be used exclusively by the core. mistaken use in other
modules results in issues in help output, as just fixed for the mp4
module.

- - - - -
78efded3 by Lyndon Brown at 2021-05-29T19:21:34+01:00
core: use true/false not 0/1 for bool options

- - - - -
4ae3922a by Lyndon Brown at 2021-05-29T19:21:35+01:00
i420_yuy2: fix double translation

such strings are supposed to be translated JIT for display by interfaces.
this mistake causes a secondary translation to occur at an earlier and
incorrect time - in execution of the plugin descriptor.

- - - - -
cfcc5fff by Lyndon Brown at 2021-05-29T19:21:35+01:00
medialibrary: fix double-translation

such strings are supposed to be translated JIT for display by interfaces.
this mistake causes a secondary translation to occur at an earlier and
incorrect time - in execution of the plugin descriptor.

- - - - -
3ca23043 by Lyndon Brown at 2021-05-29T19:21:35+01:00
asf: purge long unused constant

unused since 8f45b1e59d23079858c0e0dd83405c21701f8560

- - - - -
23901c0c by Lyndon Brown at 2021-05-29T19:21:35+01:00
qt: fix option text typo

- - - - -
5987503e by Lyndon Brown at 2021-05-29T19:21:35+01:00
mixer/remap: fix choice list type

these lists takes signed ints.

this was caught by some later work that caused a warning here.

- - - - -
518db873 by Lyndon Brown at 2021-05-29T19:21:35+01:00
speex: fix array length mismatch

the null entry should not be there. caught this with some work to be
submitted later.

- - - - -
bb632577 by Lyndon Brown at 2021-05-29T19:21:35+01:00
windrive: remove useless add_submodule() call

- - - - -
72bfbfdb by Lyndon Brown at 2021-05-29T19:21:35+01:00
os2drive: remove pointless add_submodule() call

- - - - -
94d04d84 by Lyndon Brown at 2021-05-29T19:21:35+01:00
mmal: remove pointless add_submodule() call

- - - - -


15 changed files:

- include/vlc_plugin.h
- modules/access/cdda.c
- modules/access/vcd/vcd.c
- modules/audio_filter/channel_mixer/remap.c
- modules/codec/speex.c
- modules/demux/mp4/mp4.c
- modules/gui/qt/qt.cpp
- modules/hw/mmal/converter.c
- modules/misc/medialibrary/medialibrary.cpp
- modules/mux/asf.c
- modules/services_discovery/os2drive.c
- modules/services_discovery/windrive.c
- modules/video_chroma/i420_yuy2.c
- src/config/help.c
- src/libvlc-module.c


Changes:

=====================================
include/vlc_plugin.h
=====================================
@@ -109,7 +109,6 @@ enum vlc_module_properties
 
 /* Configuration hint types */
 #define CONFIG_HINT_CATEGORY                0x02  /* Start of new category */
-#define CONFIG_HINT_USAGE                   0x05  /* Usage information */
 
 #define CONFIG_CATEGORY                     0x06 /* Set category */
 #define CONFIG_SUBCATEGORY                  0x07 /* Set subcategory */
@@ -192,7 +191,7 @@ enum vlc_module_properties
 /**
  * Current plugin ABI version
  */
-#define VLC_API_VERSION_STRING "4.0.4"
+#define VLC_API_VERSION_STRING "4.0.5"
 
 /*****************************************************************************
  * Add a few defines. You do not want to read this section. Really.
@@ -375,11 +374,10 @@ VLC_METADATA_EXPORTS
 #define set_section( text, longtext ) \
     add_typedesc_inner( CONFIG_SECTION, text, longtext )
 
+#ifndef __PLUGIN__
 #define add_category_hint(text, longtext) \
     add_typedesc_inner( CONFIG_HINT_CATEGORY, text, longtext )
-
-#define add_usage_hint( text ) \
-    add_typedesc_inner( CONFIG_HINT_USAGE, text, NULL )
+#endif
 
 #define add_string( name, value, text, longtext, advc ) \
     add_string_inner(CONFIG_ITEM_STRING, name, text, longtext, value)


=====================================
modules/access/cdda.c
=====================================
@@ -991,9 +991,12 @@ static void Close(vlc_object_t *obj)
 # endif
 #endif
 
+#define HELP_TEXT N_("Usage hint: [cdda:][device][@[track]]")
+
 vlc_module_begin ()
     set_shortname( N_("Audio CD") )
     set_description( N_("Audio CD input") )
+    set_help( HELP_TEXT )
     set_capability( "access", 0 )
     set_category( CAT_INPUT )
     set_subcategory( SUBCAT_INPUT_ACCESS )
@@ -1001,7 +1004,6 @@ vlc_module_begin ()
 
     add_loadfile("cd-audio", CD_DEVICE, CDAUDIO_DEV_TEXT, CDAUDIO_DEV_LONGTEXT)
 
-    add_usage_hint( N_("[cdda:][device][@[track]]") )
     add_integer( "cdda-track", 0 , NULL, NULL, true )
         change_volatile ()
     add_integer( "cdda-first-sector", -1, NULL, NULL, true )


=====================================
modules/access/vcd/vcd.c
=====================================
@@ -42,15 +42,17 @@
 static int  Open ( vlc_object_t * );
 static void Close( vlc_object_t * );
 
+#define HELP_TEXT N_("Usage hint: [vcd:][device][#[title][,[chapter]]]")
+
 vlc_module_begin ()
     set_shortname( N_("VCD"))
     set_description( N_("VCD input") )
+    set_help( HELP_TEXT )
     set_capability( "access", 0 )
     set_callbacks( Open, Close )
     set_category( CAT_INPUT )
     set_subcategory( SUBCAT_INPUT_ACCESS )
 
-    add_usage_hint( N_("[vcd:][device][#[title][,[chapter]]]") )
     add_shortcut( "vcd", "svcd" )
 vlc_module_end ()
 


=====================================
modules/audio_filter/channel_mixer/remap.c
=====================================
@@ -44,7 +44,7 @@ static int  OpenFilter( vlc_object_t * );
 /* wg4 channel indices in the order of channel_name */
 static const uint8_t channel_wg4idx[] = { 0, 7, 1, 4, 6, 5, 2, 3, 8 };
 
-static const unsigned channel_idx[]    = { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
+static const int channel_idx[]    = { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
 
 static const char *const channel_name[] =
 {


=====================================
modules/codec/speex.c
=====================================
@@ -87,7 +87,7 @@ static void CloseEncoder ( vlc_object_t * );
 
 static const int pi_enc_mode_values[] = { 0, 1, 2 };
 static const char * const ppsz_enc_mode_descriptions[] = {
-    N_("Narrow-band (8kHz)"), N_("Wide-band (16kHz)"), N_("Ultra-wideband (32kHz)"), NULL
+    N_("Narrow-band (8kHz)"), N_("Wide-band (16kHz)"), N_("Ultra-wideband (32kHz)")
 };
 
 vlc_module_begin ()


=====================================
modules/demux/mp4/mp4.c
=====================================
@@ -71,7 +71,7 @@ vlc_module_begin ()
     add_file_extension("mov")
     add_file_extension("mp4")
 
-    add_category_hint("Hacks", NULL)
+    set_section("Hacks", NULL)
     add_bool( CFG_PREFIX"m4a-audioonly", false, MP4_M4A_TEXT, MP4_M4A_LONGTEXT, true )
 
     add_submodule()


=====================================
modules/gui/qt/qt.cpp
=====================================
@@ -155,7 +155,7 @@ static void ShowDialog   ( intf_thread_t *, int, int, intf_dialog_args_t * );
                              " This option only works with Windows and " \
                              "X11 with composite extensions." )
 
-#define INTERFACE_SCALE_TEXT N_( "Initial user scale factor for the interface, betwwen 0.3 and 3.0" )
+#define INTERFACE_SCALE_TEXT N_( "Initial user scale factor for the interface, between 0.3 and 3.0" )
 
 #define ERROR_TEXT N_( "Show unimportant error and warnings dialogs" )
 


=====================================
modules/hw/mmal/converter.c
=====================================
@@ -64,7 +64,6 @@ static const char * const  ppsz_converter_text[] = {
 static int OpenConverter(filter_t *);
 
 vlc_module_begin()
-    add_submodule()
     set_category( CAT_VIDEO )
     set_subcategory( SUBCAT_VIDEO_VFILTER )
     set_shortname(N_("MMAL resizer"))


=====================================
modules/misc/medialibrary/medialibrary.cpp
=====================================
@@ -1976,8 +1976,8 @@ static void Close( vlc_object_t* obj )
     delete p_ml;
 }
 
-#define ML_FOLDER_TEXT _( "Folders discovered by the media library" )
-#define ML_FOLDER_LONGTEXT _( "Semicolon separated list of folders to discover " \
+#define ML_FOLDER_TEXT N_( "Folders discovered by the media library" )
+#define ML_FOLDER_LONGTEXT N_( "Semicolon separated list of folders to discover " \
                               "media from" )
 
 #define ML_VERBOSE _( "Extra verbose media library logs" )


=====================================
modules/mux/asf.c
=====================================
@@ -42,7 +42,6 @@
 #include "../demux/asf/libasf_guid.h"
 
 #define MAX_ASF_TRACKS 128
-#define ASF_DATA_PACKET_SIZE 4096  // deprecated -- added sout-asf-packet-size
 
 /*****************************************************************************
  * Module descriptor


=====================================
modules/services_discovery/os2drive.c
=====================================
@@ -39,7 +39,6 @@ VLC_SD_PROBE_HELPER("disc", N_("Discs"), SD_CAT_DEVICES)
  * Module descriptor
  */
 vlc_module_begin ()
-    add_submodule ()
     set_shortname (N_("Discs"))
     set_description (N_("Discs"))
     set_category (CAT_PLAYLIST)


=====================================
modules/services_discovery/windrive.c
=====================================
@@ -36,7 +36,6 @@ VLC_SD_PROBE_HELPER("disc", N_("Discs"), SD_CAT_DEVICES)
  * Module descriptor
  */
 vlc_module_begin ()
-    add_submodule ()
     set_shortname (N_("Discs"))
     set_description (N_("Discs"))
     set_category (CAT_PLAYLIST)


=====================================
modules/video_chroma/i420_yuy2.c
=====================================
@@ -79,8 +79,7 @@ vlc_module_begin ()
     set_callback_video_converter( Activate, 250 )
 # define vlc_CPU_capable() vlc_CPU_SSE2()
 #elif defined (MODULE_NAME_IS_i420_yuy2_altivec)
-    set_description(
-            _("AltiVec conversions from " SRC_FOURCC " to " DEST_FOURCC) );
+    set_description( N_("AltiVec conversions from " SRC_FOURCC " to " DEST_FOURCC) );
     set_callback_video_converter( Activate, 250 )
 # define vlc_CPU_capable() vlc_CPU_ALTIVEC()
 #endif


=====================================
src/config/help.c
=====================================
@@ -361,7 +361,6 @@ static void print_item(const module_t *m, const module_config_t *item,
             switch (item->i_type)
             {
                 case CONFIG_HINT_CATEGORY:
-                case CONFIG_HINT_USAGE:
                     printf(color ? GREEN "\n %s\n" GRAY : "\n %s\n",
                            module_gettext(m, item->psz_text));
 


=====================================
src/libvlc-module.c
=====================================
@@ -1524,7 +1524,6 @@ static const char *const mouse_wheel_texts[] = {
  * Quick usage guide for the configuration options:
  *
  * add_category_hint(N_(text), N_(longtext))
- * add_usage_hint( N_(text), b_advanced_option )
  * add_string( option_name, value, N_(text), N_(longtext),
                b_advanced_option )
  * add_loadfile( option_name, psz_value, N_(text), N_(longtext) )
@@ -1545,7 +1544,7 @@ vlc_module_begin ()
     set_subcategory( SUBCAT_AUDIO_GENERAL )
     add_category_hint(N_("Audio"), AOUT_CAT_LONGTEXT)
 
-    add_bool( "audio", 1, AUDIO_TEXT, AUDIO_LONGTEXT, false )
+    add_bool( "audio", true, AUDIO_TEXT, AUDIO_LONGTEXT, false )
         change_safe ()
     add_float( "gain", 1., GAIN_TEXT, GAIN_LONGTEXT, true )
         change_float_range( 0., 8. )
@@ -1607,36 +1606,36 @@ vlc_module_begin ()
     set_subcategory( SUBCAT_VIDEO_GENERAL )
     add_category_hint(N_("Video"), VOUT_CAT_LONGTEXT)
 
-    add_bool( "video", 1, VIDEO_TEXT, VIDEO_LONGTEXT, true )
+    add_bool( "video", true, VIDEO_TEXT, VIDEO_LONGTEXT, true )
         change_safe ()
-    add_bool( "grayscale", 0, GRAYSCALE_TEXT,
+    add_bool( "grayscale", false, GRAYSCALE_TEXT,
               GRAYSCALE_LONGTEXT, true )
     add_bool( "fullscreen", false, FULLSCREEN_TEXT, FULLSCREEN_LONGTEXT, false )
         change_short('f')
         change_safe ()
-    add_bool( "embedded-video", 1, EMBEDDED_TEXT, EMBEDDED_LONGTEXT,
+    add_bool( "embedded-video", true, EMBEDDED_TEXT, EMBEDDED_LONGTEXT,
               true )
     add_bool( "xlib", true, "", "", true )
         change_private ()
-    add_bool( "drop-late-frames", 1, DROP_LATE_FRAMES_TEXT,
+    add_bool( "drop-late-frames", true, DROP_LATE_FRAMES_TEXT,
               DROP_LATE_FRAMES_LONGTEXT, true )
     /* Used in vout_synchro */
-    add_bool( "skip-frames", 1, SKIP_FRAMES_TEXT,
+    add_bool( "skip-frames", true, SKIP_FRAMES_TEXT,
               SKIP_FRAMES_LONGTEXT, true )
-    add_bool( "quiet-synchro", 0, QUIET_SYNCHRO_TEXT,
+    add_bool( "quiet-synchro", false, QUIET_SYNCHRO_TEXT,
               QUIET_SYNCHRO_LONGTEXT, true )
     add_bool( "keyboard-events", true, KEYBOARD_EVENTS_TEXT,
               KEYBOARD_EVENTS_LONGTEXT, true )
     add_bool( "mouse-events", true, MOUSE_EVENTS_TEXT,
               MOUSE_EVENTS_LONGTEXT, true )
-    add_bool( "video-on-top", 0, VIDEO_ON_TOP_TEXT,
+    add_bool( "video-on-top", false, VIDEO_ON_TOP_TEXT,
               VIDEO_ON_TOP_LONGTEXT, false )
     add_bool( "video-wallpaper", false, WALLPAPER_TEXT,
               WALLPAPER_LONGTEXT, false )
     add_integer("disable-screensaver", 1, SS_TEXT, SS_LONGTEXT, true)
         change_integer_list(screensaver_values, screensaver_texts)
 
-    add_bool( "video-title-show", 1, VIDEO_TITLE_SHOW_TEXT,
+    add_bool( "video-title-show", true, VIDEO_TITLE_SHOW_TEXT,
               VIDEO_TITLE_SHOW_LONGTEXT, false )
         change_safe()
     add_integer( "video-title-timeout", 5000, VIDEO_TITLE_TIMEOUT_TEXT,
@@ -1690,8 +1689,8 @@ vlc_module_begin ()
                 MASPECT_RATIO_TEXT, MASPECT_RATIO_LONGTEXT, true )
     add_string( "custom-aspect-ratios", NULL, CUSTOM_ASPECT_RATIOS_TEXT,
                 CUSTOM_ASPECT_RATIOS_LONGTEXT, false )
-    add_bool( "hdtv-fix", 1, HDTV_FIX_TEXT, HDTV_FIX_LONGTEXT, true )
-    add_bool( "video-deco", 1, VIDEO_DECO_TEXT,
+    add_bool( "hdtv-fix", true, HDTV_FIX_TEXT, HDTV_FIX_LONGTEXT, true )
+    add_bool( "video-deco", true, VIDEO_DECO_TEXT,
               VIDEO_DECO_LONGTEXT, true )
     add_string( "video-title", NULL, VIDEO_TITLE_TEXT,
                  VIDEO_TITLE_LONGTEXT, true )
@@ -1727,9 +1726,9 @@ vlc_module_begin ()
     set_section( N_("On Screen Display") , NULL )
     add_category_hint(N_("Subpictures"), SUB_CAT_LONGTEXT)
 
-    add_bool( "spu", 1, SPU_TEXT, SPU_LONGTEXT, false )
+    add_bool( "spu", true, SPU_TEXT, SPU_LONGTEXT, false )
         change_safe ()
-    add_bool( "osd", 1, OSD_TEXT, OSD_LONGTEXT, false )
+    add_bool( "osd", true, OSD_TEXT, OSD_LONGTEXT, false )
     add_module("text-renderer", "text renderer", NULL,
                TEXTRENDERER_TEXT, TEXTRENDERER_LONGTEXT)
 
@@ -1818,7 +1817,7 @@ vlc_module_begin ()
                  INPUT_PREFERREDRESOLUTION_LONGTEXT, false )
         change_safe ()
         change_integer_list( pi_prefres, ppsz_prefres )
-    add_bool( "low-delay", 0, INPUT_LOWDELAY_TEXT,
+    add_bool( "low-delay", false, INPUT_LOWDELAY_TEXT,
               INPUT_LOWDELAY_LONGTEXT, true )
         change_safe ()
 
@@ -2007,11 +2006,11 @@ vlc_module_begin ()
                                 SOUT_KEEP_LONGTEXT, true )
     add_bool( "sout-all", true, SOUT_ALL_TEXT,
                                 SOUT_ALL_LONGTEXT, true )
-    add_bool( "sout-audio", 1, SOUT_AUDIO_TEXT,
+    add_bool( "sout-audio", true, SOUT_AUDIO_TEXT,
                                 SOUT_AUDIO_LONGTEXT, true )
-    add_bool( "sout-video", 1, SOUT_VIDEO_TEXT,
+    add_bool( "sout-video", true, SOUT_VIDEO_TEXT,
                                 SOUT_VIDEO_LONGTEXT, true )
-    add_bool( "sout-spu", 1, SOUT_SPU_TEXT,
+    add_bool( "sout-spu", true, SOUT_SPU_TEXT,
                                 SOUT_SPU_LONGTEXT, true )
     add_integer( "sout-mux-caching", 1500, SOUT_MUX_CACHING_TEXT,
                                 SOUT_MUX_CACHING_LONGTEXT, true )
@@ -2071,7 +2070,7 @@ vlc_module_begin ()
 #endif
 
 #if defined(_WIN32) || defined(__OS2__)
-    add_bool( "high-priority", 0, HPRIORITY_TEXT,
+    add_bool( "high-priority", false, HPRIORITY_TEXT,
               HPRIORITY_LONGTEXT, false )
 #endif
 
@@ -2086,40 +2085,40 @@ vlc_module_begin ()
     set_category( CAT_PLAYLIST )
     set_subcategory( SUBCAT_PLAYLIST_GENERAL )
     add_category_hint(N_("Playlist"), PLAYLIST_CAT_LONGTEXT)
-    add_bool( "random", 0, RANDOM_TEXT, RANDOM_LONGTEXT, false )
+    add_bool( "random", false, RANDOM_TEXT, RANDOM_LONGTEXT, false )
         change_short('Z')
         change_safe()
-    add_bool( "loop", 0, LOOP_TEXT, LOOP_LONGTEXT, false )
+    add_bool( "loop", false, LOOP_TEXT, LOOP_LONGTEXT, false )
         change_short('L')
         change_safe()
-    add_bool( "repeat", 0, REPEAT_TEXT, REPEAT_LONGTEXT, false )
+    add_bool( "repeat", false, REPEAT_TEXT, REPEAT_LONGTEXT, false )
         change_short('R')
         change_safe()
-    add_bool( "play-and-exit", 0, PAE_TEXT, PAE_LONGTEXT, false )
-    add_bool( "play-and-stop", 0, PAS_TEXT, PAS_LONGTEXT, false )
+    add_bool( "play-and-exit", false, PAE_TEXT, PAE_LONGTEXT, false )
+    add_bool( "play-and-stop", false, PAS_TEXT, PAS_LONGTEXT, false )
         change_safe()
-    add_bool( "play-and-pause", 0, PAP_TEXT, PAP_LONGTEXT, true )
+    add_bool( "play-and-pause", false, PAP_TEXT, PAP_LONGTEXT, true )
         change_safe()
-    add_bool( "start-paused", 0, SP_TEXT, SP_LONGTEXT, false )
+    add_bool( "start-paused", false, SP_TEXT, SP_LONGTEXT, false )
     add_bool( "playlist-autostart", true,
               AUTOSTART_TEXT, AUTOSTART_LONGTEXT, false )
     add_bool( "playlist-cork", true, CORK_TEXT, CORK_LONGTEXT, false )
 #if defined(_WIN32) || defined(HAVE_DBUS) || defined(__OS2__)
-    add_bool( "one-instance", 0, ONEINSTANCE_TEXT,
+    add_bool( "one-instance", false, ONEINSTANCE_TEXT,
               ONEINSTANCE_LONGTEXT, true )
-    add_bool( "started-from-file", 0, STARTEDFROMFILE_TEXT,
+    add_bool( "started-from-file", false, STARTEDFROMFILE_TEXT,
               STARTEDFROMFILE_LONGTEXT, true )
         change_volatile ()
-    add_bool( "one-instance-when-started-from-file", 1,
+    add_bool( "one-instance-when-started-from-file", true,
               ONEINSTANCEWHENSTARTEDFROMFILE_TEXT, NULL, true )
-    add_bool( "playlist-enqueue", 0, PLAYLISTENQUEUE_TEXT,
+    add_bool( "playlist-enqueue", false, PLAYLISTENQUEUE_TEXT,
               PLAYLISTENQUEUE_LONGTEXT, true )
 #endif
 #ifdef HAVE_DBUS
     add_bool( "dbus", false, DBUS_TEXT, DBUS_LONGTEXT, true )
 #endif
-    add_bool( "media-library", 0, ML_TEXT, ML_LONGTEXT, false )
-    add_bool( "playlist-tree", 0, PLTREE_TEXT, PLTREE_LONGTEXT, false )
+    add_bool( "media-library", false, ML_TEXT, ML_LONGTEXT, false )
+    add_bool( "playlist-tree", false, PLTREE_TEXT, PLTREE_LONGTEXT, false )
 
     add_string( "open", "", OPEN_TEXT, OPEN_LONGTEXT, false )
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/98c824ab055da3600cd9bcec17efbe25de163077...94d04d840a6abdd17883406d948fda524080225b

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/98c824ab055da3600cd9bcec17efbe25de163077...94d04d840a6abdd17883406d948fda524080225b
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list