summaryrefslogtreecommitdiffstats
path: root/libass
diff options
context:
space:
mode:
authorOleg Oshmyan <chortos@inbox.lv>2020-10-19 01:51:11 +0300
committerOleg Oshmyan <chortos@inbox.lv>2020-10-27 01:24:12 +0200
commite66e1081b432f163226170dae8f2b9ac2300bf15 (patch)
tree03581f10a3196d05f2e02fcee5b9b92418884b1f /libass
parent9b7237a89b143558c77a9ef7a8ba71fffa6ee1fb (diff)
downloadlibass-e66e1081b432f163226170dae8f2b9ac2300bf15.tar.bz2
libass-e66e1081b432f163226170dae8f2b9ac2300bf15.tar.xz
process_karaoke_effects: place line at infinity except during \kf
Fixes \k and \ko in https://github.com/libass/libass/issues/357.
Diffstat (limited to 'libass')
-rw-r--r--libass/ass_parse.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/libass/ass_parse.c b/libass/ass_parse.c
index 6e0f6f3..c0e2660 100644
--- a/libass/ass_parse.c
+++ b/libass/ass_parse.c
@@ -997,22 +997,21 @@ void process_karaoke_effects(ASS_Renderer *render_priv)
int tm_end = tm_start + start->effect_timing;
timing = tm_end;
- int x_start = 1000000;
- int x_end = -1000000;
- for (GlyphInfo *info = start; info < end; info++) {
- x_start = FFMIN(x_start, d6_to_int(info->bbox.x_min + info->pos.x));
- x_end = FFMAX(x_end, d6_to_int(info->bbox.x_max + info->pos.x));
- }
-
if (effect_type != EF_KARAOKE_KF)
tm_end = tm_start;
int x;
if (tm_current < tm_start)
- x = x_start;
+ x = -1000000;
else if (tm_current >= tm_end)
- x = x_end + 1;
+ x = 1000000;
else {
+ int x_start = 1000000;
+ int x_end = -1000000;
+ for (GlyphInfo *info = start; info < end; info++) {
+ x_start = FFMIN(x_start, d6_to_int(info->bbox.x_min + info->pos.x));
+ x_end = FFMAX(x_end, d6_to_int(info->bbox.x_max + info->pos.x));
+ }
double dt = (double) (tm_current - tm_start) / (tm_end - tm_start);
x = x_start + (x_end - x_start) * dt;
}