# HG changeset patch # User eugeni # Date 1201123110 0 # Node ID ba7bd4f7e322ce3e8b908fb467ae3ec7c30054ea # Parent 04773888ae2aecccc9190feccd7cc71066d00179 Add global ass_force_reload flag. If it is set, renderer is reconfigured before the next frame. diff -r 04773888ae2a -r ba7bd4f7e322 libass/ass_mp.c --- a/libass/ass_mp.c Wed Jan 23 21:10:15 2008 +0000 +++ b/libass/ass_mp.c Wed Jan 23 21:18:30 2008 +0000 @@ -259,3 +259,15 @@ 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); +} diff -r 04773888ae2a -r ba7bd4f7e322 libass/ass_mp.h --- a/libass/ass_mp.h Wed Jan 23 21:10:15 2008 +0000 +++ b/libass/ass_mp.h Wed Jan 23 21:18:30 2008 +0000 @@ -50,4 +50,7 @@ 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 */ diff -r 04773888ae2a -r ba7bd4f7e322 libmpcodecs/vf_ass.c --- a/libmpcodecs/vf_ass.c Wed Jan 23 21:10:15 2008 +0000 +++ b/libmpcodecs/vf_ass.c Wed Jan 23 21:18:30 2008 +0000 @@ -326,7 +326,7 @@ { 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); diff -r 04773888ae2a -r ba7bd4f7e322 libmpcodecs/vf_vo.c --- a/libmpcodecs/vf_vo.c Wed Jan 23 21:10:15 2008 +0000 +++ b/libmpcodecs/vf_vo.c Wed Jan 23 21:18:30 2008 +0000 @@ -134,7 +134,7 @@ 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;