[vlc-commits] add vout sub-text-scale variable

Francois Cartegnie git at videolan.org
Mon Sep 7 00:33:30 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Aug 28 12:59:22 2015 +0200| [fcec9fa768203e8aa5554e201f9b5887573f4ddd] | committer: Francois Cartegnie

add vout sub-text-scale variable

For cross renderers spu text sizing

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

 src/libvlc-module.c             |    6 ++++++
 src/video_output/video_output.c |    6 +++---
 src/video_output/vout_intf.c    |    3 +++
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/libvlc-module.c b/src/libvlc-module.c
index 04f0ee3..ccb7d72 100644
--- a/src/libvlc-module.c
+++ b/src/libvlc-module.c
@@ -694,6 +694,9 @@ static const char *const ppsz_prefres[] = {
     "You can use this option to place the subtitles under the movie, " \
     "instead of over the movie. Try several positions.")
 
+#define SUB_TEXT_SCALE_TEXT N_("Subtitles text scaling factor")
+#define SUB_TEXT_SCALE_LONGTEXT N_("Set value to alter subtitles size where possible")
+
 #define SPU_TEXT N_("Enable sub-pictures")
 #define SPU_LONGTEXT N_( \
     "You can completely disable the sub-picture processing.")
@@ -1625,6 +1628,9 @@ vlc_module_begin ()
                  SUB_PATH_TEXT, SUB_PATH_LONGTEXT, true )
     add_integer( "sub-margin", 0, SUB_MARGIN_TEXT,
                  SUB_MARGIN_LONGTEXT, true )
+    add_integer_with_range( "sub-text-scale", 100, 10, 500,
+               SUB_TEXT_SCALE_TEXT, SUB_TEXT_SCALE_LONGTEXT, false )
+        change_volatile  ()
     set_section( N_( "Overlays" ) , NULL )
     add_module_list( "sub-source", "sub source", NULL,
                      SUB_SOURCE_TEXT, SUB_SOURCE_LONGTEXT, false )
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 9476e5e..4a76007 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -144,12 +144,12 @@ static vout_thread_t *VoutCreate(vlc_object_t *object,
     vlc_mutex_init(&vout->p->filter.lock);
     vlc_mutex_init(&vout->p->spu_lock);
 
-    /* Initialize subpicture unit */
-    vout->p->spu = spu_Create(vout);
-
     /* Take care of some "interface/control" related initialisations */
     vout_IntfInit(vout);
 
+    /* Initialize subpicture unit */
+    vout->p->spu = spu_Create(vout);
+
     vout->p->title.show     = var_InheritBool(vout, "video-title-show");
     vout->p->title.timeout  = var_InheritInteger(vout, "video-title-timeout");
     vout->p->title.position = var_InheritInteger(vout, "video-title-position");
diff --git a/src/video_output/vout_intf.c b/src/video_output/vout_intf.c
index af6d476..04ddc62 100644
--- a/src/video_output/vout_intf.c
+++ b/src/video_output/vout_intf.c
@@ -293,6 +293,9 @@ void vout_IntfInit( vout_thread_t *p_vout )
                 VLC_VAR_INTEGER | VLC_VAR_DOINHERIT | VLC_VAR_ISCOMMAND );
     var_AddCallback( p_vout, "sub-margin", SubMarginCallback, NULL );
 
+    var_Create( p_vout, "sub-text-scale",
+                VLC_VAR_INTEGER | VLC_VAR_DOINHERIT | VLC_VAR_ISCOMMAND );
+
     /* Mouse coordinates */
     var_Create( p_vout, "mouse-button-down", VLC_VAR_INTEGER );
     var_Create( p_vout, "mouse-moved", VLC_VAR_COORDS );



More information about the vlc-commits mailing list