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

eugeni subversion at mplayerhq.hu
Wed Jan 23 22:18:31 CET 2008


Author: eugeni
Date: Wed Jan 23 22:18:30 2008
New Revision: 25841

Log:
Add global ass_force_reload flag.

If it is set, renderer is reconfigured before the next frame.


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

Modified: trunk/libass/ass_mp.c
==============================================================================
--- trunk/libass/ass_mp.c	(original)
+++ trunk/libass/ass_mp.c	Wed Jan 23 22:18:30 2008
@@ -259,3 +259,15 @@ ass_library_t* ass_init(void) {
 	free(path);
 	return priv;
 }
+
+int ass_force_reload = 0; // flag set if global ass-related settings were changed
+
+ass_image_t* ass_mp_render_frame(ass_renderer_t *priv, ass_track_t* track, long long now, int* detect_change) {
+	if (ass_force_reload) {
+		ass_set_margins(priv, ass_top_margin, ass_bottom_margin, 0, 0);
+		ass_set_use_margins(priv, ass_use_margins);
+		ass_set_font_scale(priv, ass_font_scale);
+		ass_force_reload = 0;
+	}
+	return ass_render_frame(priv, track, now, detect_change);
+}

Modified: trunk/libass/ass_mp.h
==============================================================================
--- trunk/libass/ass_mp.h	(original)
+++ trunk/libass/ass_mp.h	Wed Jan 23 22:18:30 2008
@@ -50,4 +50,7 @@ typedef struct {
 	int changed;
 } mp_eosd_images_t;
 
+extern int ass_force_reload;
+ass_image_t* ass_mp_render_frame(ass_renderer_t *priv, ass_track_t* track, long long now, int* detect_change);
+
 #endif /* ASS_MP_H */

Modified: trunk/libmpcodecs/vf_ass.c
==============================================================================
--- trunk/libmpcodecs/vf_ass.c	(original)
+++ trunk/libmpcodecs/vf_ass.c	Wed Jan 23 22:18:30 2008
@@ -326,7 +326,7 @@ static int put_image(struct vf_instance_
 {
 	ass_image_t* images = 0;
 	if (sub_visibility && vf->priv->ass_priv && ass_track && (pts != MP_NOPTS_VALUE))
-		images = ass_render_frame(vf->priv->ass_priv, ass_track, (pts+sub_delay) * 1000 + .5, NULL);
+		images = ass_mp_render_frame(vf->priv->ass_priv, ass_track, (pts+sub_delay) * 1000 + .5, NULL);
 	
 	prepare_image(vf, mpi);
 	if (images) render_frame(vf, mpi, images);

Modified: trunk/libmpcodecs/vf_vo.c
==============================================================================
--- trunk/libmpcodecs/vf_vo.c	(original)
+++ trunk/libmpcodecs/vf_vo.c	Wed Jan 23 22:18:30 2008
@@ -134,7 +134,7 @@ static int control(struct vf_instance_s*
                 ass_set_aspect_ratio(vf->priv->ass_priv, (double)res.w / res.h);
             }
 
-            images.imgs = ass_render_frame(vf->priv->ass_priv, ass_track, (pts+sub_delay) * 1000 + .5, &images.changed);
+            images.imgs = ass_mp_render_frame(vf->priv->ass_priv, ass_track, (pts+sub_delay) * 1000 + .5, &images.changed);
             if (!vf->priv->prev_visibility)
                 images.changed = 2;
             vf->priv->prev_visibility = 1;



More information about the MPlayer-cvslog mailing list