Update SSA/ASS subtitle decoder for the new version of libass included in contribs.
authorBarry Wardell <barry.wardell@gmail.com>
Thu, 23 Jul 2009 15:00:22 +0000 (16:00 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 23 Jul 2009 15:28:25 +0000 (17:28 +0200)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/codec/libass.c

index 537914e..08c8ec7 100644 (file)
@@ -342,7 +342,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;
     }
@@ -744,13 +748,21 @@ 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) );