[MPlayer-cvslog] r31754 - in trunk: configure libass/ass_mp.c libass/ass_mp.h libmpcodecs/vf_ass.c libmpcodecs/vf_vo.c

greg subversion at mplayerhq.hu
Mon Jul 19 02:12:04 CEST 2010


Author: greg
Date: Mon Jul 19 02:12:04 2010
New Revision: 31754

Log:
Require libass version with ass_flush_events

When using external libass, require an up to date version with the new
API function ass_flush_events. Get rid of the various version checks for
compatibility with older versions.

Modified:
   trunk/configure
   trunk/libass/ass_mp.c
   trunk/libass/ass_mp.h
   trunk/libmpcodecs/vf_ass.c
   trunk/libmpcodecs/vf_vo.c

Modified: trunk/configure
==============================================================================
--- trunk/configure	Mon Jul 19 01:02:25 2010	(r31753)
+++ trunk/configure	Mon Jul 19 02:12:04 2010	(r31754)
@@ -6377,11 +6377,10 @@ EOF
     cat > $TMPC << EOF
 #include <ass/ass.h>
 int main(void) {
-#if defined(LIBASS_VERSION) && LIBASS_VERSION >= 0x00907010
-  ass_process_force_style(0);
-#else
-  process_force_style(0);
+#if !defined(LIBASS_VERSION) || LIBASS_VERSION < 0x00910000
+#error "libass version too old"
 #endif
+  ass_process_force_style(0);
   return 0;
 }
 EOF

Modified: trunk/libass/ass_mp.c
==============================================================================
--- trunk/libass/ass_mp.c	Mon Jul 19 01:02:25 2010	(r31753)
+++ trunk/libass/ass_mp.c	Mon Jul 19 02:12:04 2010	(r31754)
@@ -287,14 +287,7 @@ void ass_configure_fonts(ass_renderer_t*
 	else if (font_fontconfig >= 0 && font_name) family = strdup(font_name);
 	else family = 0;
 
-#if defined(LIBASS_VERSION) && LIBASS_VERSION >= 0x00907010
         ass_set_fonts(priv, path, family, font_fontconfig, NULL, 1);
-#else
-	if (font_fontconfig >= 0)
-		ass_set_fonts(priv, path, family);
-	else
-		ass_set_fonts_nofc(priv, path, family);
-#endif
 
 	free(dir);
 	free(path);

Modified: trunk/libass/ass_mp.h
==============================================================================
--- trunk/libass/ass_mp.h	Mon Jul 19 01:02:25 2010	(r31753)
+++ trunk/libass/ass_mp.h	Mon Jul 19 02:12:04 2010	(r31754)
@@ -29,7 +29,7 @@
 #else
 #include <ass/ass.h>
 #endif
-#if defined(LIBASS_VERSION) && LIBASS_VERSION >= 0x00907010
+// FIXME: rename types used by MPlayer
 #define ass_library_t ASS_Library
 #define ass_track_t ASS_Track
 #define ass_track_s ASS_Track
@@ -38,9 +38,6 @@
 #define ass_style_t ASS_Style
 #define ass_event_t ASS_Event
 #define process_force_style(t) ass_process_force_style(t)
-#else
-void process_force_style(ass_track_t* track);
-#endif
 
 extern ass_library_t* ass_library;
 extern int ass_enabled;

Modified: trunk/libmpcodecs/vf_ass.c
==============================================================================
--- trunk/libmpcodecs/vf_ass.c	Mon Jul 19 01:02:25 2010	(r31753)
+++ trunk/libmpcodecs/vf_ass.c	Mon Jul 19 02:12:04 2010	(r31754)
@@ -89,11 +89,7 @@ static int config(struct vf_instance *vf
 
 	if (vf->priv->ass_priv) {
 		ass_configure(vf->priv->ass_priv, vf->priv->outw, vf->priv->outh, 0);
-#if defined(LIBASS_VERSION) && LIBASS_VERSION >= 0x00907010
 		ass_set_aspect_ratio(vf->priv->ass_priv, 1, 1);
-#else
-		ass_set_aspect_ratio(vf->priv->ass_priv, 1);
-#endif
 	}
 
 	return vf_next_config(vf, vf->priv->outw, vf->priv->outh, d_width, d_height, flags, outfmt);

Modified: trunk/libmpcodecs/vf_vo.c
==============================================================================
--- trunk/libmpcodecs/vf_vo.c	Mon Jul 19 01:02:25 2010	(r31753)
+++ trunk/libmpcodecs/vf_vo.c	Mon Jul 19 02:12:04 2010	(r31754)
@@ -148,11 +148,7 @@ static int control(struct vf_instance *v
                 double dar = (double) (res.w - res.ml - res.mr) / (res.h - res.mt - res.mb);
                 ass_set_frame_size(vf->priv->ass_priv, res.w, res.h);
                 ass_set_margins(vf->priv->ass_priv, res.mt, res.mb, res.ml, res.mr);
-#if defined(LIBASS_VERSION) && LIBASS_VERSION >= 0x00907010
                 ass_set_aspect_ratio(vf->priv->ass_priv, dar, (double)res.srcw/res.srch);
-#else
-                ass_set_aspect_ratio(vf->priv->ass_priv, (double)res.w / res.h);
-#endif
             }
 
             images.imgs = ass_mp_render_frame(vf->priv->ass_priv, ass_track, (pts+sub_delay) * 1000 + .5, &images.changed);


More information about the MPlayer-cvslog mailing list