summaryrefslogtreecommitdiffstats
path: root/libass/ass_parse.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-09-29 21:31:23 +0200
committerwm4 <wm4@nowhere>2012-09-29 21:31:23 +0200
commit31db1346d43e54e07bd563d8c9e6ffbdd195b84c (patch)
tree70e0ba0165796a585a1159a5feb618a6583ead73 /libass/ass_parse.h
parent6d2b7f238ec20a88d7ced4a513c6262a0b39d9ff (diff)
downloadlibass-31db1346d43e54e07bd563d8c9e6ffbdd195b84c.tar.bz2
libass-31db1346d43e54e07bd563d8c9e6ffbdd195b84c.tar.xz
Terminate drawings immediately on a \p0 tag
The parsing code allowed override tags after \p0 to affect the drawing. This is incorrect. Finish the drawing object as soon as \p0 is encountered instead. This requires moving the code executing the style overrides from get_next_char() in ass_parse.c to the main render loop in ass_renderer.c, because we have to re-enter the rendering loop inside of a tag. The old code was simply executing all tags until a new character could be returned to the renderer loop, mutating up the state (RenderContext fields) for the drawing after the drawing was closed, but before it was rendered. This fixes libass issue #47.
Diffstat (limited to 'libass/ass_parse.h')
-rw-r--r--libass/ass_parse.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/libass/ass_parse.h b/libass/ass_parse.h
index fd4fd66..88fcda8 100644
--- a/libass/ass_parse.h
+++ b/libass/ass_parse.h
@@ -34,6 +34,7 @@ void change_border(ASS_Renderer *render_priv, double border_x,
void apply_transition_effects(ASS_Renderer *render_priv, ASS_Event *event);
void process_karaoke_effects(ASS_Renderer *render_priv);
unsigned get_next_char(ASS_Renderer *render_priv, char **str);
+char *parse_tag(ASS_Renderer *render_priv, char *p, double pwr);
extern void change_alpha(uint32_t *var, uint32_t new, double pwr);
extern uint32_t mult_alpha(uint32_t a, uint32_t b);