summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Oshmyan <chortos@inbox.lv>2014-05-01 02:47:43 +0100
committerOleg Oshmyan <chortos@inbox.lv>2014-06-06 15:08:15 +0100
commit2f3ed2f5e36e645f02024e063a830c34002fe648 (patch)
tree58add2a2469f8368b6bd0967e08dd0e01af940eb
parentdcecb9cba3ab2e9c1d082c9860aecb9e437e40f6 (diff)
downloadlibass-2f3ed2f5e36e645f02024e063a830c34002fe648.tar.bz2
libass-2f3ed2f5e36e645f02024e063a830c34002fe648.tar.xz
parse_tag: split \fscx, \fscy, \fsc
-rw-r--r--libass/ass_parse.c43
1 files changed, 20 insertions, 23 deletions
diff --git a/libass/ass_parse.c b/libass/ass_parse.c
index d0d1972..aa4a206 100644
--- a/libass/ass_parse.c
+++ b/libass/ass_parse.c
@@ -321,30 +321,27 @@ char *parse_tag(ASS_Renderer *render_priv, char *p, double pwr)
} else
render_priv->state.blur = 0.0;
// ASS standard tags
- } else if (mystrcmp(&p, "fsc")) {
- char tp = *p++;
+ } else if (mystrcmp(&p, "fscx")) {
double val;
- if (tp == 'x') {
- if (mystrtod(&p, &val)) {
- val /= 100;
- val = render_priv->state.scale_x * (1 - pwr) + val * pwr;
- val = (val < 0) ? 0 : val;
- } else
- val = render_priv->state.style->ScaleX;
- render_priv->state.scale_x = val;
- } else if (tp == 'y') {
- if (mystrtod(&p, &val)) {
- val /= 100;
- val = render_priv->state.scale_y * (1 - pwr) + val * pwr;
- val = (val < 0) ? 0 : val;
- } else
- val = render_priv->state.style->ScaleY;
- render_priv->state.scale_y = val;
- } else {
- --p;
- render_priv->state.scale_x = render_priv->state.style->ScaleX;
- render_priv->state.scale_y = render_priv->state.style->ScaleY;
- }
+ if (mystrtod(&p, &val)) {
+ val /= 100;
+ val = render_priv->state.scale_x * (1 - pwr) + val * pwr;
+ val = (val < 0) ? 0 : val;
+ } else
+ val = render_priv->state.style->ScaleX;
+ render_priv->state.scale_x = val;
+ } else if (mystrcmp(&p, "fscy")) {
+ double val;
+ if (mystrtod(&p, &val)) {
+ val /= 100;
+ val = render_priv->state.scale_y * (1 - pwr) + val * pwr;
+ val = (val < 0) ? 0 : val;
+ } else
+ val = render_priv->state.style->ScaleY;
+ render_priv->state.scale_y = val;
+ } else if (mystrcmp(&p, "fsc")) {
+ render_priv->state.scale_x = render_priv->state.style->ScaleX;
+ render_priv->state.scale_y = render_priv->state.style->ScaleY;
} else if (mystrcmp(&p, "fsp")) {
double val;
if (mystrtod(&p, &val))