changeset 31688:2b6a652aefbe

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.
author greg
date Mon, 19 Jul 2010 00:12:04 +0000
parents 87831e7308b3
children c447fb125915
files configure libass/ass_mp.c libass/ass_mp.h libmpcodecs/vf_ass.c libmpcodecs/vf_vo.c
diffstat 5 files changed, 4 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Sun Jul 18 23:02:25 2010 +0000
+++ b/configure	Mon Jul 19 00:12:04 2010 +0000
@@ -6377,11 +6377,10 @@
     cat > $TMPC << EOF
 #include <ass/ass.h>
 int main(void) {
-#if defined(LIBASS_VERSION) && LIBASS_VERSION >= 0x00907010
+#if !defined(LIBASS_VERSION) || LIBASS_VERSION < 0x00910000
+#error "libass version too old"
+#endif
   ass_process_force_style(0);
-#else
-  process_force_style(0);
-#endif
   return 0;
 }
 EOF
--- a/libass/ass_mp.c	Sun Jul 18 23:02:25 2010 +0000
+++ b/libass/ass_mp.c	Mon Jul 19 00:12:04 2010 +0000
@@ -287,14 +287,7 @@
 	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);
--- a/libass/ass_mp.h	Sun Jul 18 23:02:25 2010 +0000
+++ b/libass/ass_mp.h	Mon Jul 19 00:12:04 2010 +0000
@@ -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;
--- a/libmpcodecs/vf_ass.c	Sun Jul 18 23:02:25 2010 +0000
+++ b/libmpcodecs/vf_ass.c	Mon Jul 19 00:12:04 2010 +0000
@@ -89,11 +89,7 @@
 
 	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);
--- a/libmpcodecs/vf_vo.c	Sun Jul 18 23:02:25 2010 +0000
+++ b/libmpcodecs/vf_vo.c	Mon Jul 19 00:12:04 2010 +0000
@@ -148,11 +148,7 @@
                 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);