[MPlayer-dev-eng] Patch enabling ass_line_spacing

Thomas Reitmayr treitmayr at devbase.at
Sun Sep 16 15:42:08 CEST 2007


Hi,
Using mplayer-20070824 I stumbled across the problem not being able to 
adjust the line spacing of ASS subtitles. The command line option 
-ass-line-spacing did not do anything.
In the code there seems to be a disconnect between the variable 
ass_line_spacing set via the command line and the value in libass' 
global_settings. The following patch should fix this (it might still 
need some beautification), please incorporate it if everything seems right.
Bye,
-Thomas


diff -up libass/ass.h libass/ass.h
--- old/libass/ass.h    2007-07-03 00:34:45.000000000 +0200
+++ new/libass/ass.h    2007-09-16 14:49:54.000000000 +0200
@@ -85,6 +85,7 @@ void ass_set_use_margins(ass_renderer_t*
 void ass_set_aspect_ratio(ass_renderer_t* priv, double ar);
 void ass_set_font_scale(ass_renderer_t* priv, double font_scale);
 void ass_set_hinting(ass_renderer_t* priv, ass_hinting_t ht);
+void ass_set_line_spacing(ass_renderer_t* priv, double line_spacing);
 
 /**
  * \brief set font lookup defaults
diff -up libass/ass_mp.c libass/ass_mp.c
--- old/libass/ass_mp.c    2007-05-19 16:11:41.000000000 +0200
+++ new/libass/ass_mp.c    2007-09-16 14:51:26.000000000 +0200
@@ -229,6 +229,7 @@ void ass_configure(ass_renderer_t* priv,
     else
         hinting = ass_hinting & 3;
     ass_set_hinting(priv, hinting);
+        ass_set_line_spacing(priv, ass_line_spacing);
 }
 
 void ass_configure_fonts(ass_renderer_t* priv) {
diff -up libass/ass_render.c libass/ass_render.c
--- old/libass/ass_render.c    2007-05-19 16:11:41.000000000 +0200
+++ new/libass/ass_render.c    2007-09-16 14:49:35.000000000 +0200
@@ -2392,3 +2392,7 @@ ass_image_t* ass_render_frame(ass_render
     return ass_renderer->images_root;
 }
 
+void ass_set_line_spacing(ass_renderer_t* priv, double line_spacing)
+{
+    priv->settings.line_spacing = line_spacing;
+}




More information about the MPlayer-dev-eng mailing list