summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Oshmyan <chortos@inbox.lv>2020-10-16 18:59:12 +0300
committerOleg Oshmyan <chortos@inbox.lv>2020-10-27 01:24:26 +0200
commit3df44a54416161a44ae620e4466bd823f5e97718 (patch)
treef991700399e4af532d099633349156f612f1dcec
parent8c114f64cdf76c26161a6618df123a119d4a1ed7 (diff)
downloadlibass-3df44a54416161a44ae620e4466bd823f5e97718.tar.bz2
libass-3df44a54416161a44ae620e4466bd823f5e97718.tar.xz
process_karaoke_effects: fill from right to left if rotated
This matches VSFilter.
-rw-r--r--libass/ass_parse.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libass/ass_parse.c b/libass/ass_parse.c
index a19037b..ef4b0e0 100644
--- a/libass/ass_parse.c
+++ b/libass/ass_parse.c
@@ -1013,6 +1013,16 @@ void process_karaoke_effects(ASS_Renderer *render_priv)
int x_start = d6_to_int(start->pos.x);
int x_end = d6_to_int(end[-1].pos.x + end[-1].advance.x);
double dt = (double) (tm_current - tm_start) / (tm_end - tm_start);
+ double frz = fmod(start->frz, 360);
+ if (frz > 90 && frz < 270) {
+ // Fill from right to left
+ dt = 1 - dt;
+ for (GlyphInfo *info = start; info < end; info++) {
+ uint32_t tmp = info->c[0];
+ info->c[0] = info->c[1];
+ info->c[1] = tmp;
+ }
+ }
x = x_start + (x_end - x_start) * dt;
}