]> granicus.if.org Git - libass/commit
parse_tags: handle argumentless \t inside \t() like VSFilter
authorOleg Oshmyan <chortos@inbox.lv>
Thu, 4 Jan 2018 01:37:28 +0000 (03:37 +0200)
committerOleg Oshmyan <chortos@inbox.lv>
Mon, 8 Jan 2018 20:26:29 +0000 (22:26 +0200)
commit3171bdafd1bc9b2f6118568a8d51694333e85fb9
tree6a91d68c96e2272017ae91acb9abafabf6c1945b
parent6835731c2fe4164a0c50bc91d12c43b2a2b4e799
parse_tags: handle argumentless \t inside \t() like VSFilter

\t with no parantheses inside \t() resets the animation parameters
of the \t() for subsequent tags, so they are animated as if the \t()
was the single-argument version regardless of the actual number
of arguments the \t() has.

Equivalently, you could say parentheses are implied for \t inside \t().

For example, \t(20,60,\frx0\t\fry0\frz0) animates \frx from 20 to 60 ms
and animates \fry and \frz for the whole duration of the line,
just like \t(20,60,\frx0)\t(\fry0\frz0) or \t(20,60,\frx0\t(\fry0\frz0)).

Technically, VSFilter simply resets the animation parameters for any \t
it encounters but parses the embedded tags only if the \t has the right
number of arguments. However, top-level animation parameters don't matter
because top-level tags are not animated, while any nested \t that has
parentheses terminates the containing \t because they share the closing
parenthesis, so the fact that a nested \t with empty parentheses or with
at least four arguments changes the animation parameters also doesn't
matter because the containing \t immediately ends and the changed
parameters have nothing to apply to. Thus the only situation where
this has a visible effect is a nested \t without parentheses.

Closes https://github.com/libass/libass/pull/296.
Changelog
libass/ass_parse.c
libass/ass_parse.h
libass/ass_render.c