[MPlayer-cvslog] r19545 - in trunk/libass: ass_cache.c ass_cache.h ass_render.c

eugeni subversion at mplayerhq.hu
Sat Aug 26 21:00:22 CEST 2006


Author: eugeni
Date: Sat Aug 26 21:00:21 2006
New Revision: 19545

Modified:
   trunk/libass/ass_cache.c
   trunk/libass/ass_cache.h
   trunk/libass/ass_render.c

Log:
Reset glyph cache on reconfigure.


Modified: trunk/libass/ass_cache.c
==============================================================================
--- trunk/libass/ass_cache.c	(original)
+++ trunk/libass/ass_cache.c	Sat Aug 26 21:00:21 2006
@@ -190,7 +190,7 @@
 	glyph_hash_size = 0;
 }
 
-void ass_glyph_cache_done(void)
+void ass_glyph_cache_reset(void)
 {
 	int i;
 	for (i = 0; i < GLYPH_HASH_SIZE; ++i) {
@@ -203,7 +203,12 @@
 			item = next;
 		}
 	}
-	free(glyph_hash_root);
 	glyph_hash_size = 0;
 }
 
+void ass_glyph_cache_done(void)
+{
+	ass_glyph_cache_reset();
+	free(glyph_hash_root);
+}
+

Modified: trunk/libass/ass_cache.h
==============================================================================
--- trunk/libass/ass_cache.h	(original)
+++ trunk/libass/ass_cache.h	Sat Aug 26 21:00:21 2006
@@ -44,6 +44,7 @@
 void ass_glyph_cache_init(void);
 void cache_add_glyph(glyph_hash_key_t* key, glyph_hash_val_t* val);
 glyph_hash_val_t* cache_find_glyph(glyph_hash_key_t* key);
+void ass_glyph_cache_reset(void);
 void ass_glyph_cache_done(void);
 
 #endif

Modified: trunk/libass/ass_render.c
==============================================================================
--- trunk/libass/ass_render.c	(original)
+++ trunk/libass/ass_render.c	Sat Aug 26 21:00:21 2006
@@ -1737,7 +1737,13 @@
 
 void ass_configure(ass_instance_t* priv, const ass_settings_t* config)
 {
-	memcpy(&priv->settings, config, sizeof(ass_settings_t));
+	if (memcmp(&priv->settings, config, sizeof(ass_settings_t)) != 0) {
+		mp_msg(MSGT_GLOBAL, MSGL_V, "ass_configure: %d x %d; margins: l: %d, r: %d, t: %d, b: %d  \n",
+				config->frame_width, config->frame_height,
+				config->left_margin, config->right_margin, config->top_margin, config->bottom_margin);
+		memcpy(&priv->settings, config, sizeof(ass_settings_t));
+		ass_glyph_cache_reset();
+	}
 }
 
 /**



More information about the MPlayer-cvslog mailing list