diff options
author | rcombs <rcombs@rcombs.me> | 2022-07-26 22:22:07 -0500 |
---|---|---|
committer | rcombs <rcombs@rcombs.me> | 2022-11-15 21:14:37 -0600 |
commit | b5a5175a5bc84d7bce9ac8b18ab693b7fa115ea6 (patch) | |
tree | d8183c33b876a5495459085331dd17697c49cc1e /libass/ass_parse.c | |
parent | 5c9aed60d6bc6780c053916976179af0135c871a (diff) | |
download | libass-b5a5175a5bc84d7bce9ac8b18ab693b7fa115ea6.tar.bz2 libass-b5a5175a5bc84d7bce9ac8b18ab693b7fa115ea6.tar.xz |
ass_parse: take RenderContext* in process_karaoke_effects()
Diffstat (limited to 'libass/ass_parse.c')
-rw-r--r-- | libass/ass_parse.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/libass/ass_parse.c b/libass/ass_parse.c index 350797c..2b28401 100644 --- a/libass/ass_parse.c +++ b/libass/ass_parse.c @@ -1020,19 +1020,20 @@ void ass_apply_transition_effects(RenderContext *state) * 2. sets effect_timing for all glyphs to x coordinate of the border line between the left and right karaoke parts * (left part is filled with PrimaryColour, right one - with SecondaryColour). */ -void ass_process_karaoke_effects(ASS_Renderer *render_priv) +void ass_process_karaoke_effects(RenderContext *state) { - long long tm_current = render_priv->time - render_priv->state.event->Start; + TextInfo *text_info = state->text_info; + long long tm_current = state->renderer->time - state->event->Start; int32_t timing = 0, skip_timing = 0; Effect effect_type = EF_NONE; GlyphInfo *last_boundary = NULL; bool has_reset = false; - for (int i = 0; i <= render_priv->text_info.length; i++) { - if (i < render_priv->text_info.length && - !render_priv->text_info.glyphs[i].starts_new_run) { + for (int i = 0; i <= text_info->length; i++) { + if (i < text_info->length && + !text_info->glyphs[i].starts_new_run) { - if (render_priv->text_info.glyphs[i].reset_effect) { + if (text_info->glyphs[i].reset_effect) { has_reset = true; skip_timing = 0; } @@ -1041,12 +1042,12 @@ void ass_process_karaoke_effects(ASS_Renderer *render_priv) // break, subsequent text is still part of the same karaoke word, // the current word's starting and ending time stay unchanged, // but the starting time of the next karaoke word is advanced. - skip_timing += (uint32_t) render_priv->text_info.glyphs[i].effect_skip_timing; + skip_timing += (uint32_t) text_info->glyphs[i].effect_skip_timing; continue; } GlyphInfo *start = last_boundary; - GlyphInfo *end = render_priv->text_info.glyphs + i; + GlyphInfo *end = text_info->glyphs + i; last_boundary = end; if (!start) continue; |