diff options
author | Oleg Oshmyan <chortos@inbox.lv> | 2014-05-01 00:32:50 +0100 |
---|---|---|
committer | Oleg Oshmyan <chortos@inbox.lv> | 2014-05-12 02:24:07 +0100 |
commit | b3c2b31e71b5d4e64954146658ef58be7d459e19 (patch) | |
tree | b8086d7216786bbb19bfa4452cd010b42d64a124 /libass/ass_parse.c | |
parent | 7e5a915e685acfb146b4b08e65d55727d98fc85c (diff) | |
download | libass-b3c2b31e71b5d4e64954146658ef58be7d459e19.tar.bz2 libass-b3c2b31e71b5d4e64954146658ef58be7d459e19.tar.xz |
Make \be animatable
VSFilter has supported this since version 2.39.
Use the raw floating-point value of the \be argument in the animation
formula, like xy-VSFilter has done since version 3.0.0.45 (404301a3).
Diffstat (limited to 'libass/ass_parse.c')
-rw-r--r-- | libass/ass_parse.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libass/ass_parse.c b/libass/ass_parse.c index c5729551..b8c25476 100644 --- a/libass/ass_parse.c +++ b/libass/ass_parse.c @@ -730,8 +730,11 @@ char *parse_tag(ASS_Renderer *render_priv, char *p, double pwr) } else reset_render_context(render_priv, NULL); } else if (mystrcmp(&p, "be")) { - int val; - if (mystrtoi(&p, &val)) { + double dval; + if (mystrtod(&p, &dval)) { + int val; + // VSFilter always adds +0.5, even if the value is negative + val = (int) (render_priv->state.be * (1 - pwr) + dval * pwr + 0.5); // Clamp to a safe upper limit, since high values need excessive CPU val = (val < 0) ? 0 : val; val = (val > MAX_BE) ? MAX_BE : val; |