Terminate drawings immediately on a \p0 tag
commit31db1346d43e54e07bd563d8c9e6ffbdd195b84c
authorwm4 <wm4@nowhere>
Sat, 29 Sep 2012 19:31:23 +0000 (29 21:31 +0200)
committerwm4 <wm4@nowhere>
Sat, 29 Sep 2012 19:31:23 +0000 (29 21:31 +0200)
tree70e0ba0165796a585a1159a5feb618a6583ead73
parent6d2b7f238ec20a88d7ced4a513c6262a0b39d9ff
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.
libass/ass_parse.c
libass/ass_parse.h
libass/ass_render.c