[vlc-devel] commit: Update SSA/ ASS subtitle decoder for the new version of libass included in contribs. ( Barry Wardell )

git version control git at videolan.org
Thu Jul 23 22:23:25 CEST 2009


vlc | branch: 1.0-bugfix | Barry Wardell <barry.wardell at gmail.com> | Thu Jul 23 16:00:22 2009 +0100| [1395c8681ab2c519b168e464090d38f3a9387aab] | committer: Jean-Baptiste Kempf 

Update SSA/ASS subtitle decoder for the new version of libass included in contribs.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit b670356d167bf66f870ee3daf9dbac581eaf0651)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/codec/libass.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/modules/codec/libass.c b/modules/codec/libass.c
index d36824c..4d97d4d 100644
--- a/modules/codec/libass.c
+++ b/modules/codec/libass.c
@@ -343,7 +343,11 @@ static void UpdateRegions( spu_t *p_spu, subpicture_t *p_subpic,
     if( b_fmt_changed )
     {
         ass_set_frame_size( p_ass->p_renderer, fmt.i_width, fmt.i_height );
-        ass_set_aspect_ratio( p_ass->p_renderer, 1.0 ); // TODO ?
+#if defined( LIBASS_VERSION ) && LIBASS_VERSION >= 0x00907000
+    ass_set_aspect_ratio( p_ass->p_renderer, 1.0, 1.0 ); // TODO ?
+#else
+    ass_set_aspect_ratio( p_ass->p_renderer, 1.0 ); // TODO ?
+#endif
 
         p_ass->fmt = fmt;
     }
@@ -745,14 +749,22 @@ static ass_handle_t *AssHandleHold( decoder_t *p_dec )
 #ifdef WIN32
     dialog_ProgressSet( p_dialog, NULL, 0.2 );
 #endif
+#if defined( LIBASS_VERSION ) && LIBASS_VERSION >= 0x00907000
+    ass_set_fonts( p_renderer, psz_font, psz_family, true, NULL, 0 );  // setup default font/family
+#else
     ass_set_fonts( p_renderer, psz_font, psz_family );  // setup default font/family
+#endif
 #ifdef WIN32
     dialog_ProgressSet( p_dialog, NULL, 1.0 );
 #endif
 #else
     /* FIXME you HAVE to give him a font if no fontconfig */
+#if defined( LIBASS_VERSION ) && LIBASS_VERSION >= 0x00907000
+    ass_set_fonts( p_renderer, psz_font, psz_family, false, NULL, 0 );
+#else
     ass_set_fonts_nofc( p_renderer, psz_font, psz_family );
 #endif
+#endif
     memset( &p_ass->fmt, 0, sizeof(p_ass->fmt) );
 
     /* */




More information about the vlc-devel mailing list