Add global ass_force_reload flag.

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


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25841 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
eugeni 2008-01-23 21:18:30 +00:00
parent 70fca90b2a
commit 00cce8eb30
4 changed files with 17 additions and 2 deletions

View File

@ -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);
}

View File

@ -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 */

View File

@ -326,7 +326,7 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts)
{
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);

View File

@ -134,7 +134,7 @@ static int control(struct vf_instance_s* vf, int request, void* data)
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;