[MPlayer-cvslog] r30107 - in trunk: libass/ass_mp.c libass/ass_mp.h libmpcodecs/vf_ass.c libmpcodecs/vf_vo.c libvo/video_out.h libvo/vo_gl.c libvo/vo_vdpau.c mpcommon.h

reimar subversion at mplayerhq.hu
Thu Dec 24 11:51:24 CET 2009


Author: reimar
Date: Thu Dec 24 11:51:24 2009
New Revision: 30107

Log:
Some ugly hacks to make compiling against a newer external version of libass work.

Modified:
   trunk/libass/ass_mp.c
   trunk/libass/ass_mp.h
   trunk/libmpcodecs/vf_ass.c
   trunk/libmpcodecs/vf_vo.c
   trunk/libvo/video_out.h
   trunk/libvo/vo_gl.c
   trunk/libvo/vo_vdpau.c
   trunk/mpcommon.h

Modified: trunk/libass/ass_mp.c
==============================================================================
--- trunk/libass/ass_mp.c	Thu Dec 24 11:45:05 2009	(r30106)
+++ trunk/libass/ass_mp.c	Thu Dec 24 11:51:24 2009	(r30107)
@@ -27,10 +27,7 @@
 #include "mp_msg.h"
 #include "get_path.h"
 
-#include "ass.h"
-#include "ass_utils.h"
 #include "ass_mp.h"
-#include "ass_library.h"
 
 #ifdef CONFIG_FONTCONFIG
 #include <fontconfig/fontconfig.h>
@@ -243,10 +240,14 @@ 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 >= 0x00908000
+        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	Thu Dec 24 11:45:05 2009	(r30106)
+++ trunk/libass/ass_mp.h	Thu Dec 24 11:51:24 2009	(r30107)
@@ -29,6 +29,15 @@
 #else
 #include <ass/ass.h>
 #endif
+#if defined(LIBASS_VERSION) && LIBASS_VERSION >= 0x00908000
+#define ass_library_t ASS_Library
+#define ass_track_t ASS_Track
+#define ass_track_s ASS_Track
+#define ass_renderer_t ASS_Renderer
+#define ass_image_t ASS_Image
+#define ass_style_t ASS_Style
+#define ass_event_t ASS_Event
+#endif
 
 extern ass_library_t* ass_library;
 extern int ass_enabled;

Modified: trunk/libmpcodecs/vf_ass.c
==============================================================================
--- trunk/libmpcodecs/vf_ass.c	Thu Dec 24 11:45:05 2009	(r30106)
+++ trunk/libmpcodecs/vf_ass.c	Thu Dec 24 11:51:24 2009	(r30107)
@@ -94,7 +94,11 @@ static int config(struct vf_instance_s* 
 
 	if (vf->priv->ass_priv) {
 		ass_configure(vf->priv->ass_priv, vf->priv->outw, vf->priv->outh, 0);
+#if defined(LIBASS_VERSION) && LIBASS_VERSION >= 0x00908000
+		ass_set_aspect_ratio(vf->priv->ass_priv, ((double)d_width) / d_height, ((double)width) / height);
+#else
 		ass_set_aspect_ratio(vf->priv->ass_priv, ((double)d_width) / d_height);
+#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	Thu Dec 24 11:45:05 2009	(r30106)
+++ trunk/libmpcodecs/vf_vo.c	Thu Dec 24 11:51:24 2009	(r30107)
@@ -132,7 +132,11 @@ static int control(struct vf_instance_s*
             if (video_out->control(VOCTRL_GET_EOSD_RES, &res) == VO_TRUE) {
                 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 >= 0x00908000
+                ass_set_aspect_ratio(vf->priv->ass_priv, (double)res.w / res.h, (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);

Modified: trunk/libvo/video_out.h
==============================================================================
--- trunk/libvo/video_out.h	Thu Dec 24 11:45:05 2009	(r30106)
+++ trunk/libvo/video_out.h	Thu Dec 24 11:51:24 2009	(r30107)
@@ -74,6 +74,7 @@
 #define VOCTRL_GET_EOSD_RES 29
 typedef struct {
   int w, h; // screen dimensions, including black borders
+  int srcw, srch; // unscaled source dimensions
   int mt, mb, ml, mr; // borders (top, bottom, left, right)
 } mp_eosd_res_t;
 

Modified: trunk/libvo/vo_gl.c
==============================================================================
--- trunk/libvo/vo_gl.c	Thu Dec 24 11:45:05 2009	(r30106)
+++ trunk/libvo/vo_gl.c	Thu Dec 24 11:51:24 2009	(r30107)
@@ -1156,6 +1156,7 @@ static int control(uint32_t request, voi
     {
       mp_eosd_res_t *r = data;
       r->w = vo_dwidth; r->h = vo_dheight;
+      r->srcw = image_width; r->srch = image_height;
       r->mt = r->mb = r->ml = r->mr = 0;
       if (scaled_osd) {r->w = image_width; r->h = image_height;}
       else if (aspect_scaling()) {

Modified: trunk/libvo/vo_vdpau.c
==============================================================================
--- trunk/libvo/vo_vdpau.c	Thu Dec 24 11:45:05 2009	(r30106)
+++ trunk/libvo/vo_vdpau.c	Thu Dec 24 11:51:24 2009	(r30107)
@@ -1400,6 +1400,7 @@ static int control(uint32_t request, voi
     case VOCTRL_GET_EOSD_RES: {
         mp_eosd_res_t *r = data;
         r->mt = r->mb = r->ml = r->mr = 0;
+        r->srcw = vid_width; r->srch = vid_height;
         if (vo_fs) {
             r->w = vo_screenwidth;
             r->h = vo_screenheight;

Modified: trunk/mpcommon.h
==============================================================================
--- trunk/mpcommon.h	Thu Dec 24 11:45:05 2009	(r30106)
+++ trunk/mpcommon.h	Thu Dec 24 11:51:24 2009	(r30107)
@@ -4,9 +4,10 @@
 #include "subreader.h"
 #include "libmpdemux/demuxer.h"
 #include "libmpdemux/stheader.h"
+#include "libass/ass_mp.h"
 
 extern double sub_last_pts;
-extern struct ass_track_s *ass_track;
+extern ass_track_t *ass_track;
 extern subtitle *vo_sub_last;
 
 void print_version(const char* name);


More information about the MPlayer-cvslog mailing list